-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Description
On Mac OSX, matplotlib==1.5.1, in a Virtualenv the following program saves the scattergraph output correctly to output.png:
import matplotlib
matplotlib.use('TkAgg')
import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.savefig('output.png')
However, after introducing a call to subplots_adjust, the output in output.png is blank:
import matplotlib
matplotlib.use('TkAgg')
import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.subplots_adjust(
left=0.125,
right=1.5,
bottom=3.3,
top=5,
wspace=0.4,
hspace=0.8)
plt.savefig('output.png') # results in a empty/blank .png
Is this a bug or am I using it wrong?
(I realise there are no subplots to adjust here: the above is a simplification, this was noticed in the context of a bigger script which does have subplots).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels