from matplotlib import pyplot as plt
# As png
plt.savefig('Path/FigureName.png')
# As pdf
plt.savefig('Path/FigureName.pdf')
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')
plt.imshow(img)
fig, ax = plt.subplots()
ax.imshow(img)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.set_xticks([])
ax.set_yticks([])
plt.show()
from matplotlib import pyplot as plt
# As png
plt.savefig('Path/FigureName.png')
# As pdf
plt.savefig('Path/FigureName.pdf')
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')
plt.imshow(img)
fig, ax = plt.subplots()
ax.imshow(img)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.set_xticks([])
ax.set_yticks([])
plt.show()