[Thread Prev][Thread Next][Index]

Re: [ferret_users] legend for scatter plot



With regard to the first question (legend for scatter), I still think it is very easy to do by hand (maximum 4 commands as below).

For the second question (plot limits), obviously Ferret cannot know the min/max until all the lines have been given. So then the problem is to control the line colors while giving multiple lines? You can do this with the PPL COLOR command:

ppl color,2,0,80,0    ! change pen 2 to dark green
ppl color,3,50,35,5  ! change pen 3 to brown
....

Now you can have any colors you want.

One note is that there can be problems converting to pdf if a line is white. In that case do almost white:

ppl color,6,99,99,99

One use for this is to draw white contour lines on top of a color- shade plot.

Also see SET MODE LINECOLOR, which lets you have more than 6 line colors.

Billy K


On May 3, 2011, at 2:04 AM, Yue Chao wrote:

Thank you William. I think I must make my question simple and clear by giving example. I'm trying to give an example like this:

yes? plot/i=1:100/set_up/nolab sin(i/5)   ! the first line plot
yes? ppl plot
yes? plot/over/i=1:100/nolab sin(i/5)+i/100   ! the second line plot
yes? plot/over/symbol=27/i=1:100/nolab sin(i/5)-i/100 ! a scatter plot yes? go text_legend_put2 65 68 30 "sin(i/5)" ! text_legend_put2 is another shared script within our lab to add lenged for lines
yes? go text_legend_put2 65 68 35 "sin(i/5)+i/100"

Now I added the legend for the lines in the plot, but I also want to add a legend for the third overlayed scatter points.
Maybe there is already easy way for this but I don't know.

Another question is (maybe it's better to give another mail by using different theme title), in the above plot we make, when overlaying plots, ferret doesn't know to adjust the vertical limits (min & max values) to accommodate appropriately the later-coming data and plots. so if you want to make several lines in the same plot by using plot/overlay, you need to know the maximum and minimum (absolute) value of all data first, and must use plot/set_up/vlimits=`minimum`:`maximum`, and this is tedious. Or you can also do like:

yes? plot/i=1:100/set_up/nolab sin(i/5), sin(i/5)+i/100, sin(i/5)-i/ 100, but you cannot select the color for lines.
I hope this is not too long.

Again thank you for your help!!

Chao

2011/5/2 William S. Kessler <William.S.Kessler@xxxxxxxx>
Do you mean have two different scatter plots overlaid? (Otherwise you would not need a legend). That is not a common situation so I would do this by hand:

! suppose your dots are drawn with thick red circles:
plot/set/nolab/over/col=8/sym=27 {xpos},{ypos} ! position outside the plot border ppl window ,off ! need this to allow drawing outside the border
ppl plot/over
label `xpos+.1` `ypos-.1` -1 0 .14 legend label

BK


On 02 May 2011, at 9:50 AM, Yue Chao wrote:

Dear ferret users,

As sometimes we want to draw both line and scatter points in one plot. I know how to add line legend in the plot. but for the scatter point legend, Is there any available way for this? as I read through the reference mannual and the mail archives on line, few is discussed. Thank you.

Chao

--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 77 30
Portable Phone (Mobil phone) : (33) 07 60 54  23 71
************************************************************************************





--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 77 30
Portable Phone (Mobil phone) : (33) 07 60 54  23 71
************************************************************************************




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement