Bigger title in xy plots.
Jennifer Adams
jma at COLA.IGES.ORG
Mon Nov 30 13:30:40 EST 2009
On Nov 30, 2009, at 1:05 PM, Muthuvel Chelliah wrote:
> Hello grads experts,
>
> Any help in the following help will be greatly appreciated.
>
> When I plot multiple x-y plots in a page, the standard title
> becomes too small to see. I want to plot something that
> is in bigger font size, and I do not see any options for changing
> the characteristics of title (draw title ... ), such as its
> size, color, etc. I also do not want to use 'draw string' method,
> since in that case I need to know the location, etc, which is
> cumbersome for the many plots.
>
> Thanks much in advance.
>
> Muthu/CPC
Below is a script I use instead of 'draw title' -- it automates many
of the 'cumbersome' tasks. It may meet your needs.
--Jennifer
* title.gs
*
* This is an alternative to the 'draw title' command in GrADS.
* Font characteristics are controlled by five script variables:
* height, width, color, thickness, and font number.
* The sole argument is a string of any length which may
* contain backslashes ("\") to indicate carriage returns.
* Written by Jennifer M. Adams, January 2007
*
function title (arg)
* Set the text characteristics
*height=0.25
*width=0.22
height=0.20
width=0.18
*height=0.12
*width=0.10
color=1
thickness=1
fnum=0
* Check for backslashes
nbreaks=0
len=math_strlen(arg)
i=1
while (i<=len)
char=substr(arg,i,1)
if (char = '\')
nbreaks=nbreaks+1
break.nbreaks = i
endif
i=i+1
endwhile
* Figure out where the title will go
'q gxinfo'
xlims=sublin(result,3)
ylims=sublin(result,4)
ytop=subwrd(ylims,6)
xleft=subwrd(xlims,4)
xright=subwrd(xlims,6)
xmid=xleft+(xright-xleft)/2
* Set up the string characteristics
'set string 'color' bc 'thickness
'set strsiz 'width' 'height
* Draw the title
if (nbreaks)
arg.1 = substr(arg,1,break.1-1)
if (nbreaks=1)
arg.2 = substr(arg,break.1+1,len-break.1);* two lines
nargs=2
else
i=2
while (i<=nbreaks)
s=i-1
start = break.s
start = start+1
e=i
end = break.e
length = end-start
arg.i = substr(arg,start,length)
i=i+1
endwhile
start = break.nbreaks
start = start+1
length = len-start+1
nargs=nbreaks+1
arg.nargs = substr(arg,start,length)
endif
i=1
while (i<=nargs)
'draw string 'xmid' 'ytop+(height)+((nargs-i)*(1.5*height))'
`'fnum''arg.i
i=i+1
endwhile
else
'draw string 'xmid' 'ytop+height' `'fnum''arg
endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20091130/477482f6/attachment.html
More information about the gradsusr
mailing list