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

Home » Public Forums » archive » Creating a legend on graphs in postscript, and maps
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Creating a legend on graphs in postscript, and maps [message #91449] Thu, 16 July 2015 08:51 Go to previous message
wdolan is currently offline  wdolan
Messages: 29
Registered: June 2015
Junior Member
I've got a working code that prints graphs to a postscript file, but I can't seem to get a legend to work. I have the whole set_plot, 'ps' stuff at the top of the code, so that should be running fine. But I can't seem to get a legend to appear. The plot is first set up early in the code:
plot, [0, 90], [0,1], TITLE= 'run'+rnid, ystyle=8, XTITLE= 'Latitude', /nodata, position=[ .2,.2, .75,.9]
axis, yaxis = 0, yrange= [0,1], /save, ytitle = 'Ethylene Strength (K)'

and then the first set of data is plotted on it:
if AvgEth LT GenDo AND AvgEth GT Gen125Do then begin
plots, btstruc.latitude(rnscan(j)), diff, col=240, psym=1
endif else if AvgEth LT Gen125Do AND AvgEth GT Gen150Do then begin
plots, btstruc.latitude(rnscan(j)), diff, col=220, psym=1
endif else if AvgEth LT Gen150Do AND AvgEth GT Gen175Do then begin
plots, btstruc.latitude(rnscan(j)), diff, col=200, psym=1
endif else if AvgEth LT Gen175Do AND AvgEth GT Gen2Do then begin
plots, btstruc.latitude(rnscan(j)), diff, col=170, psym=1
endif else if AvgEth LT Gen2Do then begin
plots, btstruc.latitude(rnscan(j)), diff, col=130, psym=1
endif

And then we make another Y axis, and plot that data on it:
axis, yaxis=1, yrange=[0,3E-7], ytitle='CO Concentration(ppv)', /save
grun=where(strucCo.run EQ rnid)
oplot, strucCO.latitude(grun), StrucCO.Species(minpos,grun)
oplot, [!x.crange(0), !x.crange[1]], [avgCO, avgCO], linestyle = 5

I've also got a map, not in postscript, that needs a legend. This is what the code looks like thus far for this part:

set_plot, 'x'
map_set, /NOERASE
map_continents
lat = btstruc.latitude(rnscan(j))
lon = btstruc.longitude(rnscan(j))
if AvgEth LT GenDo AND AvgEth GT Gen125Do then begin
plots, lon, lat, col=250, psym=1
endif else if AvgEth LT Gen125Do AND AvgEth GT Gen150Do then begin
plots, lon, lat, col=220, psym=1
endif else if AvgEth LT Gen150Do AND AvgEth GT Gen175Do then begin
plots, lon, lat, col= 200, psym=1
endif else if AvgEth LT Gen175Do AND AvgEth GT Gen2Do then begin
plots, lon, lat, col=170, psym=1
endif else if AvgEth LT Gen2Do then begin
plots, lon, lat, col=130, psym=1
endif

It doesn't seem like there is just a basic legend command. Or if there is, everything has to be in the format of p1=plot(x, y, etc.), and leg=legend(blah) but that style doesn't seem to want to print to postscript.

Thanks for helping out a newbie!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reducing size of vector EPS / PDF output
Next Topic: North America landmass extractiong using Land_mask function in idl

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

Current Time: Wed Oct 08 13:58:28 PDT 2025

Total time taken to generate the page: 0.00465 seconds