Re: contours negative dashed, positive solid, zero

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 20 Oct 2004 17:25:44 -0600 (MDT)

>
> In keeping with the way things usually work, I found the answer minutes
> after submitting the message - I needed two more lines:
> :
> resources.cnMonoLineDashPattern = False
> resources.cnMonoLineThickness = False
>
> so that contour_map will actually use the patterns I so ingeniously set
> up.
>
> Which brings me to another question - How do I do this without drawing
> two pictures? In my method, I call map_contour, retrieve the levels
> and then call map_contour again. I want to generate the levels but not
> plot, the first time through.
>
>
> Thanks for any help.
> --Jim

Hi Jim,

You can just turn off the drawing and the advancing of the frame for
the first call, using the special resources "nglDraw" and "nglFrame":

resources.nglDraw = False
resources.nglFrame = False

You will need to set them back to True before you map_contour
for the second time, or else you can just delete them (since these
two resources are True by default).

--Mary

> On Oct 20, 2004, at 11:12 AM, James Boyle wrote:
>
> > A very basic plot: stereographic, (90N, 270E) contours of psl anomaly
> > every 8 mb, negative dashed, positive solid, zero thicker or not
> > plotted.
> >
> > How do I do this?
> >
> > I can get everything up to manipulating the line patterns of the
> > contour lines. Using Dennis Shea's GSUN code, i can see that I need to
> > set the patterns for each line. I managed to get the contour levels by
> > the following lines of code:
> >
> > map = Ngl.contour_map(wks,pslAnom,resources)
> > levels = Ngl.get_float_array(map.contour,"cnLevels")
> >
> > then I tried to set some resources:
> >
> > cnLineDashPatterns = N.zeros((len(levels),), N.Float)
> > cnLineThicknesses = N.ones((len(levels),), N.Float)
> > for i in range(len(levels)):
> > if levels[i] < 0.:
> > cnLineDashPatterns[i] = 1
> > elif levels[i] > 0.:
> > cnLineDashPatterns[i] = 0
> > else:
> > cnLineDashPatterns[i] = 0
> > cnLineThicknesses[i] = 3
> > resources.cnLineThicknesses = cnLineThicknesses
> > resource.cnLineDashPatterns = cnLineDashPatterns
> > resources.cnLineDashPatterns = cnLineDashPatterns
> > map = Ngl.contour_map(wks,pslAnom,resources)
> >
> > But this did not seem to work - so how do you do it?
> >
> > --Jim
> >
> > _______________________________________________
> > pyngl-talk mailing list
> > pyngl-talk_at_ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
> >
>
> _______________________________________________
> pyngl-talk mailing list
> pyngl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>

-- 
-------------------------------------------------
Mary Haley                   haley_at_ucar.edu
NCAR/SCD/VETS                303-497-1254 (voice)
1850 Table Mesa Dr           303-497-1804 (fax)
Boulder, CO  80305
-------------------------------------------------
_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Wed Oct 20 2004 - 17:26:14 MDT

This archive was generated by hypermail 2.2.0 : Thu Jan 19 2006 - 21:30:16 MST