How to Change Label Font Sizes in Seaborn Last Updated : 12 Aug, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Seaborn is a powerful Python visualization library that provides a high-level interface for drawing attractive and informative statistical graphics. One of its strong points is customization, allowing you to fine-tune various aspects of your plots, including font sizes of labels, titles, and ticks. In this guide, we'll explore how to change label font sizes in Seaborn, including examples and tips for achieving the best visual presentation for your data.How to change label font sizes in Seaborn?Changing font sizes in Seaborn involves configuring Matplotlib properties either globally or locally within a specific plot. Understanding these mechanisms is crucial for creating visually appealing plots that communicate your data effectively.Basic Plot Creation in SeabornBefore diving into font customization, let’s start by creating a basic plot using Seaborn. For illustration, we'll use the tips dataset that comes with Seaborn. Python import seaborn as sns import matplotlib.pyplot as plt # Load example dataset tips = sns.load_dataset("tips") # Create a basic scatter plot sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day") plt.show() Output: Changing Font Sizes for Axis LabelsTo change the font size of axis labels, you need to access and modify the properties of the axes object returned by Matplotlib’s plotting functions.Using set_xlabel and set_ylabel Python # Create a scatter plot ax = sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day") # Customize font size for x and y axis labels ax.set_xlabel("Total Bill ($)", fontsize=14) ax.set_ylabel("Tip ($)", fontsize=14) plt.show() Using set Method Python # Create a scatter plot ax = sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day") # Set font size for both x and y labels ax.set(xlabel="Total Bill ($)", ylabel="Tip ($)") ax.xaxis.label.set_size(14) ax.yaxis.label.set_size(14) plt.show() Changing Font Sizes for Tick LabelsTick labels, which appear on the x-axis and y-axis, can be customized using the tick_params method or by directly manipulating the xticklabels and yticklabels attributes.Using tick_params Python # Create a scatter plot ax = sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day") # Customize font size for tick labels ax.tick_params(axis='both', labelsize=12) plt.show() Customizing Font Sizes for Titles and LegendsPlot Title Python # Create a scatter plot ax = sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day") # Customize the plot title font size ax.set_title("Total Bill vs. Tip", fontsize=16) plt.show() Legend Font Size Python # Create a scatter plot ax = sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day") # Customize legend font size legend = ax.get_legend() legend.set_fontsize(12) plt.show() Comment More infoAdvertise with us Next Article How to Change Label Font Sizes in Seaborn P poonamvbo5 Follow Improve Article Tags : Blogathon Data Visualization AI-ML-DS Data Science Blogathon 2024 Similar Reads Machine Learning Tutorial Machine learning is a branch of Artificial Intelligence that focuses on developing models and algorithms that let computers learn from data without being explicitly programmed for every task. In simple words, ML teaches the systems to think and understand like humans by learning from the data.Machin 5 min read Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co 11 min read Linear Regression in Machine learning Linear regression is a type of supervised machine-learning algorithm that learns from the labelled datasets and maps the data points with most optimized linear functions which can be used for prediction on new datasets. It assumes that there is a linear relationship between the input and output, mea 15+ min read Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance 10 min read Support Vector Machine (SVM) Algorithm Support Vector Machine (SVM) is a supervised machine learning algorithm used for classification and regression tasks. It tries to find the best boundary known as hyperplane that separates different classes in the data. It is useful when you want to do binary classification like spam vs. not spam or 9 min read Logistic Regression in Machine Learning Logistic Regression is a supervised machine learning algorithm used for classification problems. Unlike linear regression which predicts continuous values it predicts the probability that an input belongs to a specific class. It is used for binary classification where the output can be one of two po 11 min read Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact 12 min read 100+ Machine Learning Projects with Source Code [2025] This article provides over 100 Machine Learning projects and ideas to provide hands-on experience for both beginners and professionals. Whether you're a student enhancing your resume or a professional advancing your career these projects offer practical insights into the world of Machine Learning an 5 min read K means Clustering â Introduction K-Means Clustering is an Unsupervised Machine Learning algorithm which groups unlabeled dataset into different clusters. It is used to organize data into groups based on their similarity. Understanding K-means ClusteringFor example online store uses K-Means to group customers based on purchase frequ 4 min read K-Nearest Neighbor(KNN) Algorithm K-Nearest Neighbors (KNN) is a supervised machine learning algorithm generally used for classification but can also be used for regression tasks. It works by finding the "k" closest data points (neighbors) to a given input and makesa predictions based on the majority class (for classification) or th 8 min read Like