* The problem is universally seen on WinXP, WinVista and Ubuntu 9.10. * print matplotlib.__version__ = 0.99.1 * mpl was obtained from pythonxy on Windows and EPD on Linux * no customizations to matplotlibrc
The attached example shows a square picture with equal settings for X and Y axes. While the X ticks coincide with the inter-square borders, the Y ticks are off (marked by circles). Now look closer to the border squares. These are by one screen pixel smaller in the direction to the corresponding axis (this pixel is transferred to the axis line), except for the bottom axis where the squares are by one pixel higher. This bug leads to a vertical shift in additional marks which I put over imshow images. Can you please make it more precise? Best regards, Konstantin
import numpy as np import matplotlib.pyplot as plt x = np.random.normal(size=250000) y = np.random.normal(size=250000) nbins = 16 pixelPerBin = 16 dpi = 100 size2D = 0.8 origin2D = 0.1 figsize = nbins * pixelPerBin / (dpi * size2D) #inches fig = plt.figure(figsize=(figsize,figsize), dpi=dpi) fig.delaxes(fig.gca()) rect2D = [origin2D, origin2D, size2D, size2D] ax2DHist = fig.add_axes(rect2D, aspect='equal') range = [[-2, 2], [-2, 2]] hist2D, yedges, xedges = np.histogram2d(y, x, bins=[nbins, nbins], range=range, weights=x*y) extent = [-2, 2, 2, -2] ax2DHist.imshow(hist2D, aspect='equal', interpolation='nearest', origin='lower', extent=extent) plt.show()
<<attachment: imshow_bug.png>>
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users