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

Home » Public Forums » archive » Re: cgwindow and cgplot, bug?
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: cgwindow and cgplot, bug? [message #80974 is a reply to message #80972] Fri, 27 July 2012 05:13 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats Löfdahl writes:

> I just noticed a possible bug in cgwindow/cgplot. Here is a minimal example.
>
> The following lines make a plot with two data points represented as squares:
>
> cgwindow, /free
> cgplot,/add,[1,2],[2,1], psym=symcat(6),xrange=[0,5],yrange=[0,5]
>
> If I add the following line:
>
> cgplot,/add,/over,[1,2],[3,2], psym=symcat(9)
>
> I get two more points as circles as expected - AND the two points from the first cgplot call are ALSO turned into circles! I've updated the coyote library (five minutes ago) but the problem persists.
>
> In a cgdisplay window and without the /add keyword, the plot comes out as expected.

Yes, this is because keyword values are hard-coded when
they are added to the cgWindow. When you say PSYM=SymCat(6),
whatever SymCat(6) evaluates to is stored as the PSYM
keyword. In this case, (in almost *every* case!) that
value is 8. That happens to be the same value as
SymCat(9).

But, the solution is simple. Don't use SYMCAT here!!!
If you don't use it, then the symbol value is NOT
hard-coded, but is evaluated at the time the
cgPlot command is executed.

This problem is a result of writing the commands
incorrectly. The proper way to write these commands
is like this:

cgWindow
cgPlot, /add,[1,2],[2,1], psym=6, xrange=[0,5], yrange=[0,5]
cgplot, /add, /over, [1,2],[3,2], psym=9

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: cgwindow and cgplot, bug?
Next Topic: Re: Issues with read_png and/or profiler

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

Current Time: Fri Oct 10 14:15:06 PDT 2025

Total time taken to generate the page: 1.75576 seconds