comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Using VERT_COLORS=RGBA in PLOT()?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Using VERT_COLORS=RGBA in PLOT()? [message #88570 is a reply to message #88569] Tue, 13 May 2014 10:52 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Tuesday, May 13, 2014 10:27:55 AM UTC-6, David Grier wrote:
> Dear Folks,
>
>
>
> I am trying to create a scatter plot in IDL 8.3 (MacOS)
>
> whose symbols have different colors and alpha values.
>
> The documentation for plot() suggests that I should be able to pass a 4 x NPTS array of
>
> RGBA values to the VERT_COLORS property of plot(), where NPTS is the number of points in
>
> my data set. When I try this, IDL complains:
>
>
>
> % PLOT: Array subscript for PALETTE must have same size as source expression.
>
>
>
> Here's a minimal example:
>
>
>
> npts = 10
>
> a = findgen(2,npts)
>
> rgb = bytarr(3,npts)
>
> p1 = plot(a, vert_colors=rgb) ; works
>
> p2 = plot(a, vert_colors=rgba) ; doesn't work
>
>
>
> I'd be grateful for pointers on how to set the transparency of individual vertices
>
> in a plot.
>
>
>
> Many thanks,
>
>
>
> David

Hi David,

Looks like a bug. I'll go ahead and fix it. In the meantime, the workaround is to set the vert_colors after the plot has been created. You also need to set an rgb_table (this will also get fixed). Something like this:

npts = 10
a = findgen(2,npts)
rgba = bytarr(4,npts)
rgba[3,*] = 20b*bindgen(npts)
p2 = plot(a)
p2.rgb_table=0
p2.vert_colors=rgba

Thanks for catching this!
-Chris
ExelisVIS
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: confused about usage of IDLanROI in Itools
Next Topic: Help me understand this interpol bug in GDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:56:49 PDT 2025

Total time taken to generate the page: 0.00383 seconds