problems with grads and ms windows

Arindam Chakraborty arch at IO.MET.FSU.EDU
Fri May 26 03:04:31 EDT 2006


hi Suvarna,
        Please use 'draw string x y string' command to draw x,y labels
and title to have a full grep on their size, color, style etc. Please
find an attached file cbar1.gs (a little modification of the cbar.gs
distributed with grads) which can change font size from command line.
The usage is
'cbar1.gs <width> <height>'
where width and height in inches. Default is same as cbar.gs (0.12 and
0.13). If you specify only width then height is 0.01 higher than that.

Hope this helps,
----------------------------
 ARINDAM CHAKRABORTY
 Department of Meteorology
 Florida State University
 Tallahassee, FL-32306, USA
 Tel: +001-850-6443524 (Off)
      +001-850-5758550 (Res)
 Fax: +001-850-6449642
____________________________

On Fri, 26 May 2006, Suvarna Fadnavis wrote:

> Hi ARINDAM CHAKRABORTY,
>
>           Thank you very much for your kind help. I could increase font size of x-axis
> labels and y axis labels by 'set xlopts color <thickness> <size>' command.
> I will be grateful to you if you help me to solve some more difficulties:
> (1) I wrote title and x labels, labels using draw x lab and draw y lab commands. I am
> unable to increase/decrease their font or make them bold (thicker).
> (2) I did contour plotting in which color bar is plotted at the side of the figure. I
> want to increase the font of color bar label (value).
>
>         with regards
>          Suvarna Fadnavis
>
> On Tue, 9 May 2006 17:32:23 -0400, Arindam Chakraborty wrote
> > hi Suvarna,
> >         font size of which part of a figure you want to increase? If
> > it is a text written using 'draw string', then use 'set strsiz width
> > <height>' (width, height in inches) before drawing.
> > If you want to increase font size of axis labels, use
> > 'set xlopts color <thickness> <size>' (or ylopts for y-axis).
> > If you want to change the size of contour labels, use
> > 'set clopts color <thickness> <size>'
> >
> > PS: please use a different and proper subject line for a new post.
> > Otherwise your mail may be overlooked by the users.
> >
> > Hope this helps,
> > ----------------------------
> >  ARINDAM CHAKRABORTY
> >  Department of Meteorology
> >  Florida State University
> >  Tallahassee, FL-32306, USA
> >  Tel: +001-850-6443524 (Off)
> >       +001-850-5758550 (Res)
> >  Fax: +001-850-6449642
> > ____________________________
> >
> > On Wed, 10 May 2006, Suvarna Fadnavis wrote:
> >
> > > Hello,
> > >          I am not able to increase the font size. Please help in to do so.
> > >      suvarna
> > >
> > > On Tue, 9 May 2006 13:13:22 +0200, Antonio Parodi wrote
> > > > Hello
> > > > I have installed grads for MS Windows (Uses native windows; Getting
> > > >  win32e started </grads/Getting_win32e_Started.html).
> > > >  My operating system is Windows XP Home Edition.
> > > >  I have tested the installation using the example files provided with
> > > >  grads package and everything works properly.
> > > >  Then I have tried to visualize one grib file (200 Gb) containing the
> > > >  output of the limited area model Lokal Model and in this case grads
> > > >  crashed suddenly.
> > > >  This is the error message:
> > > >
> > > >  AppName: gradsdods.dll     AppVer: 0.0.0.0     ModName: gradsdods.dll
> > > >  ModVer: 0.0.0.0     Offset: 00040cb7
> > > >
> > > >  Moreover a number of grads commands such as gribmap and gribscan do not
> > > >  work for my windows installation
> > > >  The strange thing is that one friend of mine tried to visualize the same
> > > >  grib file with the same ctl file under linux and it works!!!
> > > >  Do you have any comment or suggestion?
> > > >  I would be also interested in installing grads on my alpha machine +
> > > >  debian, does it exist an package for this architecture?
> > > >  The one provided by the grads website, when it is compiled, generates a
> > > >  number of errors....
> > > >  I hope that someone can help me :'(
> > > >  All the best
> > > >  Antonio
> > > > ***********************************************************************
> > > > ANTONIO PARODI Ph.D
> > > > Universita' di Genova
> > > > CIMA   Centro di Ricerca Interuniversitario in Monitoraggio Ambientale
> > > > Via Cadorna, 7      17100 Savona        Italy
> > > > Phone: +39 01923027218   Fax: +39 01923027240
> > > > mailto:antonio at cima.unige.it    http://www.cima.unige.it
> > > >
> > > > ***********************************************************************
> > >
> > >
> > > With best regards
> > >  Suvarna Fadanvis
> > > Scientist –B
> > > Indian Institute Of Tropical Meteorology
> > > DR. Homi Bhabha road, Pashan, Pune, India
> > > Ph. No 25893600
> > >
>
>
> With best regards
>  Suvarna Fadanvis
> Scientist –B
> Indian Institute Of Tropical Meteorology
> DR. Homi Bhabha road, Pashan, Pune, India
> Ph. No 25893600
>
-------------- next part --------------
*
*  Script to plot a colorbar
*
*  The script will assume a colorbar is wanted even if there is 
*  not room -- it will plot on the side or the bottom if there is
*  room in either place, otherwise it will plot along the bottom and
*  overlay labels there if any.  This can be dealt with via 
*  the 'set parea' command.  In version 2 the default parea will
*  be changed, but we want to guarantee upward compatibility in
*  sub-releases.
*
function colorbar (args)
*
*  Check shading information
*
* Added ===============================================
  strwth = subwrd(args,1)
  if(strwth = '')
   strwth = 0.12
  endif

  strhgt = subwrd(args,2)
  if(strhgt = '')
   strhgt = strwth + 0.01
  endif
*===========================================================

  'query shades'
  shdinfo = result
  if (subwrd(shdinfo,1)='None') 
    say 'Cannot plot color bar: No shading information'
    return
  endif
* 
*  Get plot size info
*
  'query gxinfo'
  rec2 = sublin(result,2)
  rec3 = sublin(result,3)
  rec4 = sublin(result,4)
  xsiz = subwrd(rec2,4)
  ysiz = subwrd(rec2,6)
  ylo = subwrd(rec4,4)
  xhi = subwrd(rec3,6)
  xd = xsiz - xhi
*
*  Decide if horizontal or vertical color bar
*  and set up constants.
*
  if (ylo<0.6 & xd<1.0) 
    say "Not enough room in plot for a colorbar"
    return
  endif
  cnum = subwrd(shdinfo,5)
  if (ylo<0.6 | xd>1.5)
    xl = xhi + xd/2 - 0.4
    xr = xl + 0.2
    xwid = 0.2
    ywid = 0.5
    if (ywid*cnum > ysiz*0.8) 
      ywid = ysiz*0.8/cnum
    endif
    ymid = ysiz/2
    yb = ymid - ywid*cnum/2
    'set string 1 l 5'
    vert = 1
  else
    ymid = ylo/2
    yt = ymid + 0.2
    yb = ymid
    xmid = xsiz/2
    xwid = 0.8
    if (xwid*cnum > xsiz*0.8)
      xwid = xsiz*0.8/cnum
    endif
    xl = xmid - xwid*cnum/2
    'set string 1 tc 5'
    vert = 0
  endif
*
*  Plot colorbar
*
*  'set strsiz 0.12 0.13'
  'set strsiz 'strwth' 'strhgt
  num = 0
  while (num<cnum) 
    rec = sublin(shdinfo,num+2)
    col = subwrd(rec,1)
    hi = subwrd(rec,3)
    'set line 'col
    if (vert) 
      yt = yb + ywid
    else 
      xr = xl + xwid
    endif
    'draw recf 'xl' 'yb' 'xr' 'yt
    if (num<cnum-1)
      if (vert) 
        'draw string '%(xr+0.05)%' 'yt' 'hi
      else
        'draw string 'xr' '%(yb-0.05)%' 'hi
      endif
    endif
    num = num + 1
    if (vert); yb = yt;
    else; xl = xr; endif;
  endwhile


More information about the gradsusr mailing list