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

Home » Public Forums » archive » Overplot cgplots in graphics window
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: Overplot cgplots in graphics window [message #86338 is a reply to message #86334] Mon, 28 October 2013 10:08 Go to previous messageGo to previous message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
On Monday, October 28, 2013 11:25:45 AM UTC-4, David Fanning wrote:
> Morgan Silverman writes:
>
>
>
>> I have several data sets of trajectories that I want to plot together in one graphics window. I am able to rerun the code and have it overplot in the display window but I'm not able to save that. I've tried creating a resizable graphics window but because the cgplots commands are in a loop, IDL continually displays new graphics windows and then crashes. Is there a way that I can rerun my code with a new data set each time and overplot on the same map and then save the
>
> graphic without having to just copy and paste my code 3x in the same program?
>
>
>
> Well, of course. :-)
>
>
>
> Not sure how you found yourself in this mess (I don't see in the code
>
> you provide where you are creating the cgWindow), but the general method
>
> for loading a cgWindow with lots of commands and then making a plot of
>
> it looks like this, in general:
>
>
>
> ;--------------------------------------------------------
>
> cgWindow
>
> cgControl, Execute=0
>
> cgPlot, cgDemoData(1), YRange=[0,100], /AddCmd
>
> cgLoadCT, 33, NColors=4, Bottom=1
>
> FOR j=0,3 DO BEGIN
>
> cgPlotS, cgDemoData(17), Color=Byte(j) + 1B, /AddCmd
>
> ENDFOR
>
> cgControl, Execute=1
>
> cgControl, Output='overplots.png'
>
> END
>
> ;--------------------------------------------------------
>
>
>
> Create the cgWindow, turn updating off while you add a bunch of
>
> commands. Then turn window updating on and create the output.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Sorry, I forgot to mention that the included code was in a procedure and the main program had
cgWindow, 'Plot_DAQ_Trajectories', wbackground='white', wxsize=600, wysize=500, wtitle='Westerly Flow'

I still have several questions and some clarification though. In your example using cgWindow, you use cgPlot to begin. When I try to apply this to my code I get data plotted but no map background because cgPlot doesn't allow map=mapCoord. Is this correct or do I have things in the wrong order.

Also, to clarify. Once I have completed the loop, what I need to do is rerun the entire code with a new dataset going through the same calculations and plotting loop. At the moment this creates a new window, but I want to put in the same window as the first time I ran the code. Is this possible? Thanks.

-Morgan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cgHistoplot -- input histogram results?
Next Topic: blocking user from changing graphics properties in widget_window

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

Current Time: Sat Oct 11 15:39:06 PDT 2025

Total time taken to generate the page: 0.95860 seconds