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 #86334 is a reply to message #86333] Mon, 28 October 2013 08:25 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
[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: Sun Oct 12 02:33:49 PDT 2025

Total time taken to generate the page: 0.08605 seconds