- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to remove or hide X-axis labels from a Seaborn / Matplotlib plot?
To remove or hide X-axis labels from a Seaborn/Matplotlib plot, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Use sns.set_style() to set an aesthetic style for the Seaborn plot.
Load an example dataset from the online repository (requires Internet).
To hide or remove X-axis labels, use set(xlabel=None).
To display the figure, use show() method.
Example
from matplotlib import pyplot as plt import seaborn as sns plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True sns.set_style("whitegrid") tips = sns.load_dataset("tips") ax = sns.boxplot(x="day", y="total_bill", data=tips) ax.set(xlabel=None) plt.show()
Output
- Related Articles
- How to remove X or Y labels from a Seaborn heatmap?
- How to hide axes but keep axis-labels in 3D Plot with Matplotlib?
- Hide axis values but keep axis tick labels in matplotlib
- How to plot int to datetime on X-axis using Seaborn?
- How to plot a non-square Seaborn jointplot or JointGrid? (Matplotlib)
- How to rotate X-axis tick labels in Pandas bar plot?
- How to display X-axis labels inside the plot in base R?
- How to display X-axis labels with dash in base R plot?
- How to change the color of the axis, ticks and labels for a plot in matplotlib?
- Increasing the space for X-axis labels in Matplotlib
- How to plot the X-axis labels on the upper-side of the plot in R?
- How to center labels in a Matplotlib histogram plot?
- How to create a plot with tick marks between X-axis labels in base R?
- How to remove Y-axis labels in R?
- How to X-axis labels to the top of the plot using ggplot2 in R?

Advertisements