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
../.local/lib/python3.4/site-packages/matplotlib/image.py:375: UserWarning: Images are not supported on non-linear axes.
warnings.warn("Images are not supported on non-linear axes.")
With python 3.4.3 and matplotlib 2.0.0rc1 it produces
Thus, 2.0.0 assumes that underneath the linear bin id of the numpy array tmp lies a linear data extend (y-axis) scaling.
If however my logarithmic extent is mapped correctly onto the linear bin id of the numpy array - the old behavior is exactly what represents the data.
Is it possible to reproduce the old behavior without relabeling the y-axis by hand?
Is there an option, the tell imshow directly that a specify data axis is already log-scaled?
and if so: Is it possible to have the same behavior independent of the matplotlib version used?
System:
Ubuntu 14.04.5 - Linux-Kernel 4.4.0-38
Matplotlib and Python are available via the HPC module system (probably via pip)
It should be possible to do this more efficiently with Axes.pcolorfast, but it doesn't work with a log scale. That's a bug.
When testing this sort of thing, use a rectangular array (not a square), and a regular pattern, so you can be sure you are getting the orientation the way you intend it.
Activity
tacaswell commentedon Dec 22, 2016
To be clear, you were relying on a bug / undefined behavior. The new behavior is in arguably correct.
I think you want to be using http://matplotlib.org/examples/pylab_examples/image_nonuniform.html in 2.0+ but not sure if that will work as expected in <2.0.
I think
pcolorand friends will work in all cases, see http://matplotlib.org/examples/pylab_examples/pcolor_demo.htmlphobson commentedon Dec 22, 2016
Agree with @tacaswell about pcolor. This works in 1.5 and the 2.0 RC:
http://stackoverflow.com/a/20844584/1552748
efiring commentedon Dec 22, 2016
Don't use pcolor--it's slow, and has no advantages in most cases. Use pcolormesh. Supply the cell boundaries explicitly:
It should be possible to do this more efficiently with Axes.pcolorfast, but it doesn't work with a log scale. That's a bug.
When testing this sort of thing, use a rectangular array (not a square), and a regular pattern, so you can be sure you are getting the orientation the way you intend it.
[-]imhow with yscale('log') changes scaling with 2.0.0[/-][+]document that imshow now respects scale[/+]DOC: explain logscales and imshow (closes matplotlib#7661)
DOC: explain logscales and imshow (closes matplotlib#7661)
DOC: explain logscales and imshow (closes matplotlib#7661)
Merge pull request #7800 from phobson/doc-imshow-logscale
Merge pull request #7800 from phobson/doc-imshow-logscale
PrometheusPi commentedon Feb 15, 2017
Thanks a lot for your help. I finally had the time to implement the
pcolormeshapproach in our code. It works like a charm.mforbes commentedon Feb 12, 2018
What about when loading an RGB image from file?
pcolormeshdoes not obviously accept RGB data...