Jeff Kowalczyk, on 2011-02-25 23:20,  wrote:
> I am trying to plot multiple series on one axes and a bar chart on a shared x,
> new y axes. I'm using twinx. The following test code works, but I need to 
> render
> the bar plot *behind* the line plots. Can I somehow control zorder globally
> within a figure?

Hi Jeff,

add these two lines before your plt.show()

  ax1.set_zorder(ax2.get_zorder()+1) # put ax in front of ax2
  ax1.patch.set_visible(False) # hide the 'canvas'

> 
> Alternatively, I could make the bar chart the first plot/axes ax1, but the
> position for its y-axis must be on the right, the line chart's y-axis on the
> left. Can this be controlled?

  ax1.yaxis.tick_right()
  ax2.yaxis.tick_left()

best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to