chevron_left
Axes Cookbook
0
0
0
new
Removing axis in Matplotlib
Programming
chevron_rightPython
chevron_rightMatplotlib
chevron_rightCookbooks
chevron_rightAxes Cookbook
schedule Mar 10, 2022
Last updated Python●Matplotlib
Tags tocTable of Contents
expand_more To completely remove an axis in Matplotlib, set plt.axis("off")
like so:
plt.figure(figsize=(3,2.5))plt.plot([1,2,3])plt.axis("off")plt.show()
This gives the following:

Notice how all the axis labels are removed as well, leaving just the curve.
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...