Re: contours negative dashed, positive solid, zero thick- Answer

From: James Boyle <boyle5_at_nyahnyahspammersnyahnyah>
Date: Wed, 20 Oct 2004 11:23:29 -0700

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

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
Received on Wed Oct 20 2004 - 12:23:55 MDT

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