Hi,
This is something we've planned to add for a long time: more flexibility to the legend-line plotting. "go legend" and "go legline" cannot do it; they both use an old capability called "aline" which can only draw lines based on the default line-type numbers, with line 1 always drawn as a thin black line, line 2 a thin red line, and so forth.
Please try the attached script "linekey.jnl". It is somewhat similar to "legend.jnl" in that it adds one line to the legend, but it lets you pass in the plot qualifiers you want to use. It will also allow the legend to be placed outside the plot box. Read the comments at the start of the script for some details. Note that this is new and has not been heavily tested - it accounts for the aspect ratio of the plot in positioning and spacing the legend lines, but it may need some adjustments. It will be part of future Ferret/PyFerret releases.
The script "test_linekey.jnl" also attached, does a few
examples. Here is a short example of how it looks, making a
couple of line plots and a legend in the lower left. The
arguments are
! simple example calling the linekey.jnl script
yes? cancel mode logo
yes? go margins 1.4 1.4 1.2 1.2yes? plot/nolab/i=1:60/thick/sym=20/color=blue cos(i/7)
yes?
plot/over/nolab/i=1:60/thick/size=0.16/line/sym=30/color=red
sin(i/10)
yes? go linekey 1 "line 1" plot/thick/sym=20/color=blue llc
yes? go linekey 2 "line 2"
plot/thick/size=0.16/line/sym=30/color=red llc
yes? frame/file=example_linekey.png
Dear Ferreters,
G'day
I am trying to put a legend to my plot in which i used symbol (sym=29). I am trying to put that symbol as my legend but I am unable to do so. here is my code.
use "/media/srathore/Binny/data/rain/mine/noaa_prel/precip_calender.nc"
plot/ov/thick=3/noaxes/nolab/nokey/col=4/opacity=70 precip[x=110E:155E@ave,y=45S:10S@ave,t=16-jan-1972:16-dec-1974]/precip[x=110E:155E@ave,y=45S:10S@ave,t=16-jan-1972:16-dec-1974@std]
plot/thick=2/ov/noaxes/nolab/nokey/col=1/opacity=30/sym=29/size=.6 precip[x=141E:155E@ave,y=29S:10S@ave,t=16-jan-1972:16-dec-1974]/precip[x=141E:155E@ave,y=29S:10S@ave,t=16-jan-1972:16-dec-1974@std]
!plot/ov/nolab/col=1/thick=2/opacity=30/sym=29 12,4
!go legend 5 rain-Qld
ppl plot/ov
So how to put this symbol as a legend on my desired location, with my choice of color, thickness, opacity and size ?
cheers, saurabh
--
REGARDS
Saurabh RathoreResearch Scholar (PhD.)Centre For Oceans, Rivers, Atmosphere & Land Science TechnologyIndian Institute Of Technology, Kharagpurcontact :- 91- 8345984434