[Thread Prev][Thread Next][Index]
Re: [ferret_users] Colobar with Text labels
Hi Imran & Paul,
Here is an example for labelling the color key with
given text strings. You can add more options to control the color/thickness
or font style of the text labels in a similar manner to the way in which
the alignment, font size and rotation is controlled in the present script.
Please note that this method is not 100% fool proof but it works at least
with this example.
Hope this helps
With Regards,
Jaison
!-----------example begins here--------------------------------
\ cancel mode verify
!
! Example for text labels on color key. Color key is assumed to be
! in the default orientation. Options for color/thickness and
! font style controls of text labels can be added.
!
! Note : If you face any problem (or peculiar behaviour) with repeat
! execution of this script within the same ferret
! session/prompt, try to run it in a new ferret session.
!
!------------------------------------------------------------------
set data levitus_climatology
define view/xlim=0:0.83/ylim=0:1 v1 ; set view v1 ! make room for
! text key labels
set reg/k=1/x=30:120/y=-30:30
! how to remove the default numerical labels on color key ?...not that
! easy. Font size 0 will not work, with this value Ferret will assign
! a meaningfull font size automatically. Labelling interval can be set
! to a very big number...but the first one will be labelled in any case!
! Setting significant digits to zero will remove the numerical labels
! but now "*" will appear instead....the final solution is to set the
! font size to a "tiny" value which cannot be distinguised on the plot!!!
! Please note that "too tiny" value may have the same effect as zero
! according to the available precision. 1/1e10 works fine on my 32-bit
! Linux PC.
shade/set temp
ppl shakey , ,`1/1e10`
ppl shade
go land
! Now label the key (here the orientation of the key is in the default way)
cancel reg/all ! it is safe to cancel previously set X or I regions
let key_text = XSEQUENCE({"desert","short grass","tundra","everg shrub",\
"decid shrub","tall grass","crop","irrig crop","mixed tree",\
"decid tree", "everg tree"}) ! order is key-bottom to key-top
let key_num = `key_text,r=iend` ! number of key entries
let key_xlo = 7.3 ! x position start
let key_ylo =-0.05 ! y position start
let key_xgap = 0.02 ! x gap between labels
let key_ygap = 0.585 ! y gap between labels
let key_algn = -1 ! text alignment
let key_rot = 0 ! text rotation
let key_fsz = 0.15 ! text font size
let key_x = key_xlo + key_xgap/2 ! initialize
let key_y = key_ylo + key_ygap/2 ! "
! since the color key orientation is vertical, only key_y needs to
! be updated within the repeat loop
REPEAT/RANGE=1:`key_num`:1/NAME=ky (;\
define symbol kky = `ky` ;\
label/nouser `key_x`,`key_y`,`key_algn`,`key_rot`,`key_fsz` `key_text[i=($kky)]` ;\
let key_y = `key_y` + `key_ygap` ;\
)
!----------end of example-------------------------------------------------
On Mon, 15 Jan 2007, IMRAN NADEEM wrote:
> Hi Paul,
>
> Thanks for your reply. Although there are number of programs to do
> this, yet its much convenient if I can do this in ferret.
>
> Imran
>
> On 12 Jan 2007 16:33:27 +0000, Paul Young < paul.young@xxxxxxxxxxxxxxxx>
> wrote:
> >
> > Hi Imran,
> >
> > Perhaps the easiest way to get the text as you would like is to edit the
> > post-script output in a program such as Adobe Illustrator. I often do
> > this to add and move text labels for plots that I'm going to show. Sorry
> > this isn't a 'ferret' answer!
> >
> > Paul
> >
> >
> >
> > On Fri, 2007-01-12 at 16:27, IMRAN NADEEM wrote:
> > > Hi Ferret users,
> > >
> > > I want to plot colorbar wtih text labels as shown in attached
> > > image. Can anyone give me some hints to do this in ferret?
> > >
> > > Imran
> > >
> > >
> > > --
> > > Imran Nadeem
> > > PhD Student
> > > Institute of Meteorology
> > > Department of Water, Atmosphere and Environment
> > > Uni. of Natural Resources and Applied Life Sciences (BOKU)
> > >
> > > Peter-Jordan Strasse 82
> > > 1190 Vienna, Austria
> > >
> > > Mobile: +43 699 1194 3044
> > > Tel.: +43 1 47654 5614
> > > Fax: +43 1 47654 5610
> >
>
>
>
>
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement