Closed
Description
Bug summary
The keyword argument transform
of the method ax.plot(...) malfunctions with size of the samples greater than 1000.
For example, the following script
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
ax = plt.gca()
xx = np.linspace(0.0, 4 * np.pi, num=1001)
yy = np.cos(xx)
t = transforms.Affine2D().translate(10.0, 0.0).scale(2.0, 0.5)
lines = ax.plot(xx, yy, transform=t + ax.transData)
plt.show()
Produces an expected figure
with num=1000
and an empty figure
with num=1001
.
Code for reproduction
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
ax = plt.gca()
xx = np.linspace(0.0, 4 * np.pi, num=1001)
yy = np.cos(xx)
t = transforms.Affine2D().translate(10.0, 0.0).scale(2.0, 0.5)
lines = ax.plot(xx, yy, transform=t + ax.transData)
plt.show()
Actual outcome
Expected outcome
Operating system
Linux
Matplotlib Version
3.4.3
Matplotlib Backend
Qt5Agg
Python version
Python 3.8.7
Jupyter version
No response
Other libraries
No response
Installation
pip
Conda channel
No response