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 
Switch to threaded view of this topic 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 next 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!
Re: Creating a legend on graphs in postscript, and maps [message #91452 is a reply to message #91449] Thu, 16 July 2015 10:35 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 07/16/2015 05:51 PM, wdolan@oxy.edu wrote:
> It doesn't seem like there is just a basic legend command

http://www.idlcoyote.com/gallery/

Example #2

Cheers,

Fabien
Re: Creating a legend on graphs in postscript, and maps [message #91454 is a reply to message #91452] Thu, 16 July 2015 11:23 Go to previous messageGo to next message
wdolan is currently offline  wdolan
Messages: 29
Registered: June 2015
Junior Member
Hi Fabian,

Thanks! I didn't have the coyote graphics before, but I just downloaded it to the place where all my files are located. When I type cglegend (or any of the cg commands), it says that it doesn't recognize the procedure. How do I get it to recognize the cg functions?


On Thursday, July 16, 2015 at 10:35:15 AM UTC-7, Fabien wrote:
> On 07/16/2015 05:51 PM, wdolan@oxy.edu wrote:
>> It doesn't seem like there is just a basic legend command
>
> http://www.idlcoyote.com/gallery/
>
> Example #2
>
> Cheers,
>
> Fabien
Re: Creating a legend on graphs in postscript, and maps [message #91462 is a reply to message #91454] Thu, 16 July 2015 15:42 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
There is something wrong with the way your !path is set up for IDL. Look at

http://www.idlcoyote.com/code_tips/installcoyote.php

for advice on settng up your !path on Windows or Unix.

On Thursday, July 16, 2015 at 2:23:24 PM UTC-4, wdo...@oxy.edu wrote:
> Hi Fabian,
>
> Thanks! I didn't have the coyote graphics before, but I just downloaded it to the place where all my files are located. When I type cglegend (or any of the cg commands), it says that it doesn't recognize the procedure. How do I get it to recognize the cg functions?
>
Re: Creating a legend on graphs in postscript, and maps [message #91472 is a reply to message #91462] Fri, 17 July 2015 10:45 Go to previous message
wdolan is currently offline  wdolan
Messages: 29
Registered: June 2015
Junior Member
Great, thank you! All fixed.

On Thursday, July 16, 2015 at 3:42:38 PM UTC-7, wlandsman wrote:
> There is something wrong with the way your !path is set up for IDL. Look at
>
> http://www.idlcoyote.com/code_tips/installcoyote.php
>
> for advice on settng up your !path on Windows or Unix.
>
> On Thursday, July 16, 2015 at 2:23:24 PM UTC-4, wdo...@oxy.edu wrote:
>> Hi Fabian,
>>
>> Thanks! I didn't have the coyote graphics before, but I just downloaded it to the place where all my files are located. When I type cglegend (or any of the cg commands), it says that it doesn't recognize the procedure. How do I get it to recognize the cg functions?
>>
  Switch to threaded view of this topic Create a new topic Submit Reply
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 07:16:55 PDT 2025

Total time taken to generate the page: 0.00643 seconds