-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Milestone
Description
When using matplotlib.image.NonUniformImage
with large values on axis (~10e+7), the plot breaks.
I am plotting a random matrix and simply offsetting the axis by with a large value:
The code
import numpy
import matplotlib.pyplot as plt
from matplotlib.image import NonUniformImage
offset = 9.*10**6 # XXX change this XXX
nx = 60
ny = 100
x = numpy.arange(offset, offset+nx)
y = numpy.arange(offset, offset+ny)
z = numpy.random.rand(ny, nx)
ax = plt.subplot(111)
im = NonUniformImage(ax, extent=(offset, offset+nx, offset, offset+ny))
im.set_data(x, y, z)
ax.images.append(im)
ax.set_xlim(offset, offset+nx)
ax.set_ylim(offset, offset+ny)
plt.show()
By changing the offset
variable, one can achieve different results: 1.
is ok; 9.
is broken.
Thank you