On Mon, Sep 30, 2013 at 4:50 PM, KURT PETERS <petersk...@msn.com> wrote:

> That doesn't seem to fix it.  What I'm expecting is at the top, 28 should
> correspond to the value -2.  Instead it puts a 30 there.
> Kurt
>
>

It's not really clear to me what you're trying to do. But the rounding of
the axes limits is an expected behavior of matplotlib. You can set them
manually if you like. Also, I think this achieves what you want and is much
simpler.


import numpy as np
import matplotlib.pyplot as plt

xdat=np.arange(1,11)
simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])


fig, (ax1, ax2) = plt.subplots(nrows=2, sharey=True)

ax1.plot(xdat,idatanp)
ax2.plot(simtimedata, idatanp,'k--')
ax2.set_xlim([simtimedata.min(), simtimedata.max()])

fig.tight_layout()
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to