problem with multiaxis plot

'''Hi, I use the following program in a simulation class

    > to demonstrate the niftyness of matplotlib. The
    > combination of Python, Numeric, and matplotlib really
    > makes a great set of tools for biologists who are largely
    > non-programmers these days. Thanks.

Great -- do you have class notes? I will be using the same
combination in a class I am teaching to biologists this fall and am
working on a manuscript with Fernando Perez, basically an introduction
to scientific computing in python.

    > I just did a big upgrade from 0.6-before pylab to
    > 0.80. This is the only tested program that didn't produce
    > the same results before and after:

    > Attached are matlab and pylab png files.

Take a look at the release notes at
http://matplotlib.sf.net/whats_new.html for release 0.72. We improved
the way we do multiscale axes and shared axis axes, and the interface
changed somewhat. See examples/shared_axis_demo.py,
examples/two_scales.py and examples/ganged_plots.py. The examples are
available in a zip file on the website.

    > Is there another way of doing this that gets back to the
    > original output?
Yes

    ax1 = subplot(111)
    t = arange(0.01, 10.0, 0.01)
    s1 = exp(t)
    plot(t, s1, 'b-')
    xlabel('time (s)')
    ylabel('exp')

    ax2 = twinx() ### <- this is the new way
    s2 = sin(2*pi*t)
    plot(t, s2, 'r.')
    ylabel('sin')

    > Also, is it just my imagination, or does 0.8 take longer
    > to display graphs than previous versions. I haven't done
    > any formal timing, but the delay seems longer.

I hope it's your imagination :slight_smile:

JDH

Take a look at the release notes at
http://matplotlib.sf.net/whats_new.html for release 0.72. We improved
the way we do multiscale axes and shared axis axes, and the interface
changed somewhat. See examples/shared_axis_demo.py,
examples/two_scales.py and examples/ganged_plots.py. The examples are
available in a zip file on the website.

Thanks for the information. I haven't been keeping up with matplotlib
improvements very well. Looking back at the release notes, its amazing how
fast the progress has been.

The ylim() and twinx() functions greatly improved the readibility, and
restored the functionality.

   > Is there another way of doing this that gets back to the
   > original output?
Yes

   > Also, is it just my imagination, or does 0.8 take longer
   > to display graphs than previous versions. I haven't done
   > any formal timing, but the delay seems longer.

I hope it's your imagination :slight_smile:

Apparently just my imagination, rebooting the computer speeded things up
noticibly.

Wendell Cropper

JDH

University of Florida
School of Forest Resources and Conservation
214 Newins-Ziegler
PO Box 110410
Gainesville, FL 32611-0410

352-846-0859 phone
352-392-1707 fax

wcropper@...416...

John Hunter wrote:

See examples/shared_axis_demo.py,
examples/two_scales.py and examples/ganged_plots.py.

Speaking of which: I just put a ganged plot made with matplotlib into a grant proposal. It worked really well with one exception: the top value of the y axis on each graph was printed on top of the bottom value of the graph above. If you look carefully, you'll see that examples/ganged_plots.py does the same thing.

Any good way to avoid this?