chevron_left
Axes Cookbook
check_circle
Mark as learned thumb_up
0
thumb_down
0
chat_bubble_outline
0
auto_stories new
settings
Removing axis in Matplotlib
Matplotlib
chevron_rightCookbooks
chevron_rightAxes Cookbook
schedule Jul 1, 2022
Last updated local_offer Python●Matplotlib
Tags tocTable of Contents
expand_more Check out the interactive map of data science
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?
thumb_up
thumb_down
Ask a question or leave a feedback...
thumb_up
0
thumb_down
0
chat_bubble_outline
0
settings
Enjoy our search
Hit / to insta-search docs and recipes!