1. Close the coordinate scale (plt and AxesSubplot)
-
plt
-
plt .xticks ( [])
-
plt .yticks ( [])
Close the axis:
plt.axis('off')
Note that if similar operations are to work, they need to be placed before plt.show () and after plt.imshow ().
-
-
对于 ax(matplotlib.axes._subplots.AxesSubplot)
-
ax.set_xticks([])
-
ax.set_yticks([])
-
2. Set the dpi of the image to be saved
- dpi:Dots Per Inch
plt.savefig(..., dpi=150)
3. The coordinate axis is not visible
-
frame = plt.gca()
-
# y axis is not visible
-
frame.axes.get_yaxis().set_visible( False)
-
# x axis is not visible
-
frame.axes.get_xaxis().set_visible( False)