python画图的dpi设置
https://stackoverflow.com/questions/47633546/relationship-between-dpi-and-figure-sizeimport numpy as npimport matplotlib.pyplot as pltx=np.linspace(-2,2)y=np.sin(x)plt.figure(figsize=(10,8),dpi=50)plt
·
https://stackoverflow.com/questions/47633546/relationship-between-dpi-and-figure-size
import numpy as np
import matplotlib.pyplot as plt
x=np.linspace(-2,2)
y=np.sin(x)
plt.figure(figsize=(10,8),dpi=50)
plt.plot(x,y)
plt.savefig("./1.png")
plt.show()
plt.figure(figsize=(5,7))
plt.plot(x,y)
plt.savefig("./2.png")
plt.show()
更多推荐
所有评论(0)