Re: drawing lines through cell centres on a map

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 03 2009 - 11:02:18 MST

Hi Mark,

Actually with a little variation on Mary's script it is possible to
keep multiple windows on the screen in a script run on the command
line as well. The trick is simply to set wkPause and gsnFrame back to
True for the last window you draw to:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

x = (/10.,20.,30.,40.,50.,60.,70.,80.,90./)
y = (/0.,0.71,1.,0.7,0.002,-0.71,-1.,-0.71,-0.003/)

type = "x11"
type@wkPause = False

wks1 = gsn_open_wks(type,"xtest1")
type@wkPause = True
wks2 = gsn_open_wks(type,"xtest2")

res = True
res@gsnFrame = False

plot1 = gsn_csm_xy(wks1,x,y,res)

res@gsnFrame = True
plot2 = gsn_csm_xy(wks2,x,y+5,res)

  -dave

On Dec 3, 2009, at 10:26 AM, Mary Haley wrote:

>
> Mark,
>
> From your description it sounds like you are running interactively.
>
> To turn off the expected key click for an X11 window, you can set the
> "wkPause" resource to False.
>
> You also need to turn off the frame advance.
>
> Here's a sample code. Note that this only works for interactive mode,
> because if you run this as a script, the
> X11 windows will go away.
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> x = (/10.,20.,30.,40.,50.,60.,70.,80.,90./)
> y = (/0.,0.71,1.,0.7,0.002,-0.71,-1.,-0.71,-0.003/)
>
> type = "x11"
> type@wkPause = False
>
> wks1 = gsn_open_wks(type,"xtest1")
> wks2 = gsn_open_wks(type,"xtest2")
>
> res = True
> res@gsnFrame = False
>
> plot1 = gsn_csm_xy(wks1,x,y,res)
>
> plot2 = gsn_csm_xy(wks2,x,y+5,res)
>
> The other thing you can do here, if you want to control the locations
> of the windows,
> is to create two files "xtest1.res" and "xtest2.res" and set the
> following four resources:
>
> In xtest1.res:
>
> *wkX : 0
> *wkY : 0
> *wkWidth : 700
> *wkHeight : 700
>
> In xtest2.res:
>
> *wkX : 750
> *wkY : 0
> *wkWidth : 700
> *wkHeight : 700
>
>
> This will cause the second plot to be to the right of the first one.
>
> Of course, you may need to adjust the width and height for your
> screen.
>
> I'm not sure if you can set these resources directly in the script. I
> tried to, but got an error.
> There may be a bug in gsn_open_wks, which I'll look into.
>
> --Mary
>
>
>
>
>
> On Dec 2, 2009, at 6:30 PM, Dennis Shea wrote:
>
>> G'day
>>
>> wks = gsn_define_wks("x11", "foo_0")
>> :
>> plot = gsn_contour(wks,...)
>> ----
>>
>> wks1 = gsn_define_wks("x11", "foo_1")
>> :
>> plot = gsn_contour(wks1,...)
>> ----
>>
>> wks2 = gsn_define_wks("x11", "foo_2")
>> :
>> plot = gsn_contour(wks2,...)
>> ----
>>
>> Good luck
>>
>> mark collier wrote:
>>> Hi,
>>> I often pop up x11 windows from a NCL session. I'm wondering if
>>> there
>>> is someway of popping up more than one x11 window from a single
>>> session? At the moment I have to kill (by clicking on it) the window
>>> before proceeding to the next line of code.
>>> Thanks,
>>> Mark.
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 3 11:02:24 2009

This archive was generated by hypermail 2.1.8 : Mon Dec 07 2009 - 16:12:30 MST