How to hide axes in matplotlib.pyplot

Question:

I put the image in a NumPy array, and draw it with the following code. How can I tell the program not to draw the axes, like (0, 100, 200...)

import matplotlib.pyplot as plt

plt.figure()
plt.imshow(output_ndarray)
plt.savefig(output_png)

aflw picture

Asked By: Dylan

||

Answers:

plt.xticks([])
plt.yticks([])

http://matplotlib.org/api/pyplot_api.html

Answered By: Victor Chubukov

enter image description hereYou can also use…

plt.axis('off')

enter image description here

Answered By: NaN
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.