Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to hide axes in matplotlib.pyplot

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

like image 945
Dylan Avatar asked Oct 19 '16 01:10

Dylan


2 Answers

enter image description hereYou can also use...

plt.axis('off')

enter image description here

like image 147
NaN Avatar answered Oct 28 '22 04:10

NaN


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

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

like image 31
Victor Chubukov Avatar answered Oct 28 '22 06:10

Victor Chubukov