- 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 label and change the scale of a Seaborn kdeplot's axes? (Matplotlib)
To label and change the scale of a Seaborn kdeplot's axes, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Create random data points using numpy.
- Plot Kernel Density Estimate (KDE) using kdeplot() method.
- Set Y-axis tscale and label.
- To display the figure, use show() method.
Example
import numpy as np import seaborn as sns from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True data = np.random.randn(10) k = sns.kdeplot(x=data, shade=True) plt.yticks(k.get_yticks(), k.get_yticks()) plt.ylabel('Y', fontsize=7) plt.show()
Output
- Related Articles
- Change x axes scale in matplotlib
- How to customize the axis label in a Seaborn jointplot using Matplotlib?
- How to change the font properties of a Matplotlib colorbar label?
- How to change axes background color in Matplotlib?
- Rotating axes label text in 3D Matplotlib
- How to plot a jointplot with 'hue' parameter in Seaborn? (Matplotlib)
- How to change the scale of an existing table in Matplotlib?
- How to change the figuresize using Seaborn factorplot in Matplotlib?
- Matplotlib log scale tick label number formatting
- How to unset 'sharex' or 'sharey' from two axes in Matplotlib?
- How to understand Seaborn's heatmap annotation format?
- How to add a shared x-label and y-label to a plot created with Pandas' plot? (Matplotlib)
- How do I change matplotlib's subplot projection of an existing axis?
- How to change the scale of imshow in matplotlib without stretching the image?
- Bold font weight for LaTeX axes label in Matplotlib

Advertisements