Seaborn is a graphic library built on top of Matplotlib. It allows to make your charts prettier, and facilitates some of the common data visualisation needs (like mapping a color to a variable or using faceting). This page gives
general tips concerning this awesome library. Visit individual chart sections if you need a specific type of plot. The Seaborn documentation is also very well done and help going further. Most of the customisations that work
for Matplotlib work for Seaborn, so do not hesitate to visit the Matplotlib page of the gallery. Last but not least, note that loading seaborn before a matplotlib plot allows you to benefit from its well looking style!
If you are a newbie in dataviz and seaborn, I suggest to follow this datacamp online course. The third part is dedicated to seaborn.
Sponsors
Seaborn style on top of matplotlib
If you know how to make a chart with matplotlib, just load the seaborn library and your chart will look way better:
- #106 Matplotlib style
- #106 .. with Seaborn style
Seaborn themes
- #104 white grid theme
- #104 darkgrid theme
- #104 white theme
- #104 dark theme
Manage colors
- #101 Diverging color palette
- #101 Discrete color palette
- #101 Continuous color palette
- #101 Reverse a palette
- #196 Available colors
Since Seaborn is built on top of matplotlib, most of the customization available on Matplotlib work on seaborn as well. This is especially true for axis, annotation and margin:
Manage axis
- #191 Custom axis title
- #191 Custom ticks
- #191 Custom axis labels
- #191 Axis limits
Margins
- #192 Bottom margin
- #192 Top margin
Annotations
- #193 Annotate with text
- #193 Add an ellipse
- #193 Add math equation
- #193 Horizontal and Vertical lines
- #193 Add a segment
- #193 Add a circle
- #193 Add a rectangle
Marginal plots
If you have a huge amount of dots on your graphic, it is advised to represent the marginal distribution of both the X and Y variables. This is easy to do using the jointplot() function of the Seaborn library.
- #82 Default Marginal plot
- #82 Custom marginal area
- #82 2D contour with marginal plots
- #82 Custom color of marginal plot
Random examples using seaborn
- #185 Lollipop with conditional color
- #184 Lollipop with 2 groups
- #183 Highlight a group in lollipop
- #132 Basic connected scatterplot
- #120 Basic line chart
- #55 Order violinplot by median
- #54 Grouped violinplot | seaborn
- #74 Density plot for several variables
- #73 Control bandwidth of density plot
- #32 Add notch to seaborn boxplot
- #34 Grouped Boxplot
- #25 Histogram with faceting
- #24 Histogram with boxplot on top
- #21 Custom density | seaborn