How to draw circle on background map

Mary Jo Nath Mary-Jo.Nath at NOAA.GOV
Tue Jul 17 16:51:54 EDT 2007


Jeffrey,

I don't know of simple command to draw the circle, but you could do it using
"draw mark" and "q w2xy" commands in a script.   This isn't very
sophisticated,
but it should do the trick:

*circle center point lon, lat and radius in degrees
clon=0.
clat=0.
degrees=15

* find X&Y of circle center
'q w2xy 'clon' 'clat
x1=subwrd(result,3)
y1=subwrd(result,6)

* find X&Y of point center+radius

radlon=clon+degrees

'q w2xy 'radlon' 'clat
x2=subwrd(result,3)
y2=subwrd(result,6)

*circle size = 2 x  radius
csize=(x2-x1)*2

*draw circle centered on x1,y1 with diameter of csize
'draw mark 3 'x1' 'y1' 'csize

MJ


JEFFREY S GALL wrote:
> Grads users,
>
> I have a global map extending around the globe between about 40N and
> 40S.  I would like to draw a shaded circle centered at lat=0, lon=0
> with a radius of 15 degrees.  How would I go about doing this?  Any
> help would be most appreciated.
>
> Thanks,
>
> Jeff
>
>
>
>



More information about the gradsusr mailing list