save plot as image python

49

save plot as image python -

from matplotlib import pyplot as plt

plt.savefig('Path/FigureName.png')

save plot in python -

plt.savefig('books_read.png')

python plot jpg image -

%pylab inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('your_image.png')
imgplot = plt.imshow(img)
plt.show()

save plot as image python matplotlib -

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(0, 10, 0.1)
y = np.sin(x)

plt.plot(x, y)
plt.savefig('saved_figure.png')

save plotly figure as png python -

fig.write_image("images/fig1.png")

Comments

Submit
0 Comments