|
From: KURT P. <pet...@ms...> - 2013-10-01 15:59:33
|
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 npimport matplotlib.pyplot as pltxdat=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()]) REPLY:============================================================ here's what SHOULD be happening | 0 1 5 9 13 18 21 24 25 28 3 | x | x x | x x | x x-1|_x__________________x_____ 1 2 3 4 5 6 7 8 9 10 How can I make that happen? Instead, MPL is autoranging the top axis. I don't want that I just want the actual labels to occur up there. Kurt |