|
From: Christopher B. <Chr...@no...> - 2006-02-06 23:24:07
|
Andrea Gavana wrote: > BTW, I didn't receive any answer on this thread: > > http://sourceforge.net/mailarchive/forum.php?thread_id=9639992&forum_id=33405 > > Do you happen to have some suggestion on how to solve this issue? Well, you got me curious, so what I did was start by writing an OO version of the script that worked: #!/usr/bin/env python import matplotlib, pylab import matplotlib.numerix as N Fig = pylab.figure() ax1 = Fig.add_subplot(111) t = N.arange(0.01, 10.0, 0.01) s2 = N.sin(2*N.pi*t) ax1.plot(t, s2, 'r.') ax1.set_ylabel('sin') #Create second axes with ticks on right # code adapted from pylab.twinx ax2 = Fig.add_axes(ax1.get_position(), sharex=ax1, frameon=False) ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') s1 = N.exp(t) ax2.plot(t, s1, 'b-') ax2.set_xlabel('time (s)') ax2.set_ylabel('exp') pylab.show() Then I put it in my simple wxmpl example. It works. I've enclosed that. You need to click the "plot" button to make it plot. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |