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
Overplot cgplots in graphics window [message #86333] Mon, 28 October 2013 08:00 Go to previous message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
Hello,

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? I've included the basis of my plotting. All datasets have the same variable names and I'd like to not make my code gigantic by specifying each separately. Thanks.

Sincerely,
Morgan


; Set up map projection
mapCoord = Obj_New('cgmap', 'Stereographic', Ellipsoid='WGS 84', Limit=limit, $
center_lat=centarlat, center_lon=centerlon, position=pp)
mapCoord -> Draw
cgMap_Grid, map=mapCoord, /box
cgMap_Continents, map=mapCoord, /continents, /countries, /usa
for j=0,n_elements(index)-1 do begin
if (j eq 0 and loc(0) eq 72) then begin
start = 0
stops = loc(j)
endif else begin
if (j eq 0 and loc(0) ne 72) then begin
start = flightloc(index(j)-1)+1
stops = loc(j)
endif else begin
start = loc(j-1)+1
stops = loc(j)
endelse
endelse
cgplots, Avg2000Lon, Avg2000Lat, map=mapCoord, color='blue',/window
cgplots, Avg2500Lon, Avg2500Lat, map=mapCoord, color='green',/window
cgplots, Avg3000Lon, Avg3000Lat, map=mapCoord, color='cyan',/window
cgplots, Avg3500Lon, Avg3500Lat, map=mapCoord, color='magenta',/window
al_legend,['1500 m', '2000 m', '2500 m', '3000 m', '3500 m'], linestyle=[0,0,0,0,0], $
color=['red', 'blue', 'green', 'cyan', 'magenta'], /left, charsize=0.9
cgtext, 0.5*total(!x.window), !y.window[1]+2.5*!d.y_ch_size/!d.y_vsize,'Flight 5 07/11/11 ', /normal,align=0.5
endfor
[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: Wed Oct 08 16:09:07 PDT 2025

Total time taken to generate the page: 0.00209 seconds