[Thread Prev][Thread Next][Index]

Re: [ferret_users] legend for scatter plot



Thank you!! Patrick's answer works very well. It's a smart way to draw all the variables in the first plot command, to avoid the need to find the maximum and minimum values for all the variables and then use "plot/vlimits=minimum:maximum..." to draw lines.

William, I understand very well the latter part of your answer. but for the first, "I still think it is very easy to do by hand (maximum 4 commands as below).", here you miss something?
I beg if you can give a command just in the case of the example I show?

Best,

Chao

2011/5/3 Brockmann Patrick <Patrick.Brockmann@xxxxxx>
Yue Chao a écrit :

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!!

Hi,
You can draw several variable in a first step to set the horizontal and vertical limits
from the ranges of variables plotted.
Then overlay the same variables by changing each time the color.

But it is true that a qualifier /colors to specify the colors to be used
with HTML codes would be nice.
Something like:
/colors=("3B63E6", "FF4500", "FFE000", "34D314", "FF1392", "FFA400")


!============================
! To define more than 6 colors
set mode linecolors:30

! Color for graticule: a light grey
! ppl color indice, percent_red, percent_green, percent_blue
ppl color 7, 80, 80, 80

!============================
! Define dummy variables
let varA=sin(i[i=1:60]/10)
let varB=sin(i[i=1:60]/11)
let varC=sin(i[i=1:60]/12)
let varD=sin(i[i=1:60]/13)
let varE=sin(i[i=1:60]/14)

!============================
! Plot all variables together to set horizontal vertical limits from all variables
plot/nolab/line=1/grat=(dash,color=7) varA, varB, varC, varD, varE

! Overlay my color line plot for each variable
ppl color 8, 34, 57, 89
plot/nolab/over/line/thick=2/color=8  varA
ppl color 9, 100, 27, 49
plot/nolab/over/line/thick=2/color=9  varB
ppl color 10, 50, 78, 19
plot/nolab/over/line/thick=2/color=10 varC
ppl color 11, 10, 90, 79
plot/nolab/over/line/thick=2/color=11 varD
ppl color 12, 60, 60, 89
plot/nolab/over/line/thick=2/color=12 varE


Patrick

--
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
ICMC - IPSL Climate Modelling Centre
--




--
***********************************************************************************
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