Re: how to make a multi-panel bar plot?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 24 Nov 2008 11:40:39 -0700 (MST)

Hi Gary,

Instead of using Ngl.polygon, Ngl.polyline, try using Ngl.add_polygon
and Ngl.add_polyline. This causes the lines and polygons to be attached
to the plot, so that when you draw or resize the plot, the lines and
polygons will get drawn and/or resized too.

These functions behave exactly the same, except you need
to make sure they return some kind of unique variable

   dum1 = Ngl.add_polygon(wks,plot,xbar,ybar,gsres) # Fill the bar.
   dum2 = Ngl.add_polyline(wks,plot,xbar,ybar) # Outline the bar.


On Mon, 24 Nov 2008, Gary Bates wrote:

> hi,
> I have a working pyngl code which makes a bar plot. Now I want to make a
> 3-panel bar plot. The panel examples use plot.append to do this, but I can't
> work out how to use this approach with Ngl.polygon and Ngl.polyline below:
> # Loop through each Y point, and create and draw a bar for it.
> for i in xrange(len(y)):
> xbar,ybar = get_bar(x[i],y[i],dx,ymin)
> print xbar
> print ybar
> plot=Ngl.xy(wks,xbar,ybar,res)
> gsres.gsFillColor = colors[5] # Set color for bar.
> Ngl.polygon(wks,plot,xbar,ybar,gsres) # Fill the bar.
> Ngl.polyline(wks,plot,xbar,ybar) # Outline the bar.
> Anyone know the solution to this problem?
> -Gary
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Mon Nov 24 2008 - 11:40:39 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 09:25:48 MST