[Thread Prev][Thread Next][Index]
Re: 2d-Plot with symbols
Hi Nicolas,
As Hein Zelle mensioned, it will be better to distinguish between
negative and positive values by color. And you can do it easily with the "go" file
"polymark.jnl" (included in the ferret/go directory). Or if you want closed &
open circles itself ..then you can use polymark.jnl file to get closed circles
and "plot/vs/over" to get open circles. All these are detailed in the following
example. One disadvantage of this polymark (rather polygon) method is that for
safety we need to specify the X-Y region region in "[ ]" instead of
using"set reg/" command.
Please let me know if you have any doubts about this method & example.
With Reards
Jaison
----------example.jnl-----------
! This example works well if we omit "set reg" command.
! so define the following variables to define the interested domain.
define symbol x_lo = 30 ! lower lon of domain
define symbol x_hi = 120 ! higher lon of domain
define symbol y_lo = -30 ! lowe lat of domain
define symbol y_hi = 30 ! higher lat of domain
set data etopo120
! "polymark.jnl" go file uses "polygon" command.
! "polygon" command needs xpoints & ypoints of the data_values
! and the data_values it self as one-dimensional data
! defined over a common axis (say X).
! So the trick is to make lat and lon values first a 2D data
! (see lat2D and lon2D) and then sample it back to a 1D data
! using XSEQUECE (if common axis is X)..sounds strange right ?
! It is because we have..say variable(ni,nj) then we need to have
! lon1D(ni*nj), lat1D(ni*nj), data_values1D(ni*ni) so that all
! three have total "ni*nj" points over a common "axis".
! Don't use set region anywhere.
let lon2D = x[gx=rose,x=($x_lo):($x_hi)]+y[gy=rose,y=($y_lo):($y_hi)]*0
let lat2D = x[gx=rose,x=($x_lo):($x_hi)]*0+y[gy=rose,y=($y_lo):($y_hi)]
let lat1D = XSEQUENCE(lat2D)
let lon1D = XSEQUENCE(lon2D)
let rose1D = XSEQUENCE(rose[x=($x_lo):($x_hi),y=($y_lo):($y_hi)])
! first make a base plot then the overlay of variable values with polygon
! see the "polymark.jnl" in ferret/go dir or have try with polymark_demo
! to know the options for the polymark go file.
! Please note that the polygon "scale" is > the normal symbol size
! This is a color fill.....
fill/levels=(0,0,1) rose[x=($x_lo):($x_hi),y=($y_lo):($y_hi)]
go polymark poly/ov/key lon1D lat1D rose1D circle 0.6
go land 1
message
! Now to get +ve values with closed circle and -ve values with open circle
! ......let us plot the +ve values using polymark go file and black
! pallete by specifying the posive range explicitly .."LEVELS".
set window/clear
fill/levels=(0,0,1) rose[x=($x_lo):($x_hi),y=($y_lo):($y_hi)] ! base plot
go polymark poly/ov/palette=black/levels=(0,10000,10000) lon1D lat1D rose1D circle 0.6
message
! Now define new data_value1D, lon1D and lat1D so that everything is
! defined only for -ve values and use plot/vs with the symbol 28 for
! open circle instead of polygon.
let rose1D_neg = IF rose1D LT 0 THEN rose1D
let lat1D_neg = IF rose1D_neg LT 0 THEN lat1D
let lon1D_neg = IF rose1D_neg LT 0 THEN lon1D
plot/ov/vs/nolab/symbol=28/size=0.06 lon1D_neg, lat1D_neg
go land 1
!-------------------end of example.jnl---------------------
On Tue, 28 Sep 2004, Nicolas Schneider wrote:
> Dear ferret users
>
> I have 2-dimensional (x-y) data of temperature differences. I would now
> like to draw a 2D-plot with symbols instead of filled grid boxes
> (SHADE). That means that instead of a filled grid box, I would like to
> draw a symbol reflecting the value in that grid box. Positive
> temperature differences should be drawn with filled circles with the
> size depending on the magnitude of the temperature difference.
> Contrastingly, negative temperature differences should be drawn with
> open circles, again depending on the magnitude of the difference.
>
> Is this possible with ferret? Where should I look for? Under SHADE
> commands or PLOT commands?
>
> Thanks for any help,
> Nicolas
>
>
--
___________________________________________________
Jaison Kurian
Centre for Atmospheric and Oceanic Sciences
Indian Institute of Science
B A N G A L O R E 560 012
Ph: +91-80-3942505
+91-80-3600450
Fax:+91-80-3600865
___________________________________________________
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement