-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Milestone
Description
imshow() ignores or misinterprets the aspect kwarg when interpolation='none'. The bug appears only in svg output, does not seem to be a problem in pdf or png output. The minimal code to reproduce the bug is below:
import numpy as np
import matplotlib
matplotlib.use('SVG')
import matplotlib.pyplot as plt
mat = np.ones((40,20))
plt.figure()
plt.subplot(121)
plt.imshow(
mat,
aspect=0.5,
interpolation='nearest')
plt.subplot(122)
plt.imshow(
mat,
aspect=0.5,
interpolation='none')
plt.savefig('/tmp/test.svg')An image of the output is attached below. The issue also appears when I try to use extent kwarg instead of aspect, i.e. see below (if needed, I can attach an image produced by the second example):
plt.figure()
plt.subplot(121)
plt.imshow(
mat,
interpolation='nearest',
extent=[0,20,20,0]
)
plt.subplot(122)
plt.imshow(
mat,
interpolation='none',
extent=[0,20,20,0]
)
plt.savefig('/tmp/test2.svg')My python environment is:
Ubuntu 16.04, anaconda python distribution, python 3.5.2, Matplotlib 1.5.1 (from conda)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
