You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the code below, which uses set.xscale("log") and NonUniformImage. Choose the move tool (Arrows in all 4 directions) and try to pan the image around. Instead of panning, image distorts.
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotaspltfrommatplotlib.imageimportNonUniformImagechg=np.logspace(0,1,10)
chg1=chg[:,None]
chg2=chg[None,:]
g=chg1+chg2g+=50*(np.add.outer(np.arange(10),np.arange(10))%2)
#checkerboard, to make effect clearerfig,ax=plt.subplots()
ax.set_xscale("log")
ax.set_yscale("log")
im=NonUniformImage(ax,extent=[chg[0],chg[-1],chg[0],chg[-1]],origin="lower")
im.set_data(np.linspace(1,10,10),np.linspace(1,10,10),g)
ax.add_image(im)
plt.show()
Actual outcome
These are supposed to be the same image. I just used the pan tool.
But the aspect ratio has changed. And the boundary of the rightmost colour change has gone from 0.75 to 0.5.
Clicking and dragging produces behaviour that is visually obviously not-right.
Expected outcome
The image should pan around.
Additional information
No bug appears when I use a plt.imshow on the log scale axis. Or when I use the same NonUniformImage code without the logscale axis. The bug only appears with all 3 conditions are met.
I was trying to find a sensible way to display an image on log-log axes with constant screen space per pixel, when I discovered this bug.
Operating system
Ubuntu
Matplotlib Version
3.8.0
Matplotlib Backend
QtAgg
Python version
Python 3.11.5
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered:
The boundaries not being correct does actually behave the same way on a linear scale - if you scroll past the lower limit (1) in the example above the axes stays blue, instead of scrolling past the image into an empty white area.
Bug summary
Run the code below, which uses set.xscale("log") and NonUniformImage. Choose the move tool (Arrows in all 4 directions) and try to pan the image around. Instead of panning, image distorts.
Code for reproduction
Actual outcome
These are supposed to be the same image. I just used the pan tool.
But the aspect ratio has changed. And the boundary of the rightmost colour change has gone from 0.75 to 0.5.
Clicking and dragging produces behaviour that is visually obviously not-right.
Expected outcome
The image should pan around.
Additional information
No bug appears when I use a plt.imshow on the log scale axis. Or when I use the same NonUniformImage code without the logscale axis. The bug only appears with all 3 conditions are met.
I was trying to find a sensible way to display an image on log-log axes with constant screen space per pixel, when I discovered this bug.
Operating system
Ubuntu
Matplotlib Version
3.8.0
Matplotlib Backend
QtAgg
Python version
Python 3.11.5
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: