Seaborn is actually quite good for data visualization | by Mostafa Gazar | Towards Data Science

Seaborn is a Python data visualization library based on matplotlib (it is the go to library for plotting in Python). Seaborn provides a high-level interface for drawing attractive and informative statistical graphics.
%matplotlib inlineimport matplotlib.pyplot as pltimport seaborn as sns
sns.set()
You can also customize seaborn theme or use one of six variations of the default theme. Which are called deep, muted, pastel, bright, dark, and colorblind.
# Plot color palettedef plot_color_palette(palette: str):    figure = sns.palplot(sns.color_palette())    plt.xlabel("Color palette: " + palette)    plt.show(figure)palettes = ["deep", "muted", "pastel", "bright", "dark", "colorblind"]for palette in palettes:    sns.set(palette=palette)    plot_color_palette(palette)
You can follow the following examples at your own pace by using this colab file. Google’s Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud.
We will use the tips dataset here which would help us go through some real examples.
tips = sns.load_dataset("tips")tips.head()
Let us starting by doing a scatter plot with multiple semantic variables to visualize the dataset we are dealing with.
sns.relplot(x="total_bill", y="tip",             col="time", # Categorical variables that will determine the faceting of the grid.            hue="smoker", # Grouping variable that will produce elements with different colors.            style="smoker", # Grouping variable that will produce elements with different styles.            size="size", # Grouping variable that will produce elements with different sizes.            data=tips)
There are several specialized plot types in seaborn that are optimized for visualizing relationship between different variables (numeric and categorical). They can be accessed through relplot.
We can also plot linear regression model using lmplot.
sns.lmplot(x="total_bill", y="tip",            col="time", # Categorical variables that will determine the faceting of the grid.           hue="smoker", # Grouping variable that will produce elements with different colors.           data=tips)
Or simply:
sns.lmplot(x="total_bill", y="tip", data=tips)
sns.lmplot(x="size", y="tip", data=tips)
sns.lmplot(x="size", y="tip", data=tips, x_estimator=np.mean)
tips["big_tip"] = (tips.tip / tips.total_bill) > .15sns.lmplot(x="total_bill", y="big_tip",           y_jitter=.03,            logistic=True,            data=tips)
There are also other several specialized plot types in seaborn that are optimized for visualizing categorical variables. They can be accessed through catplot.
sns.catplot(x="day", y="total_bill",             hue="smoker", # Grouping variable that will produce elements with different colors.            kind="swarm", # Options are: "point", "bar", "strip", "swarm", "box", "violin", or "boxen"            data=tips)
Alternately, we could use kernel density estimation to represent the underlying distribution that the points are sampled from.
sns.catplot(x="day", y="total_bill",             hue="smoker", # Grouping variable that will produce elements with different colors.            kind="violin", # Options are: "point", "bar", "strip", "swarm", "box", "violin", or "boxen"            split=True,             data=tips)
Or you could show the only mean value and its confidence interval within each nested category.
sns.catplot(x="day", y="total_bill",             hue="smoker", # Grouping variable that will produce elements with different colors.            kind="bar", # Options are: "point", "bar", "strip", "swarm", "box", "violin", or "boxen"            data=tips)
jointplot and pairplot make visualizations with multiple plots possible. jointplot focuses on a single relationship while pairplot takes a broader view, showing all pairwise relationships and the marginal distributions, optionally conditioned on a categorical variable.
sns.jointplot(x="total_bill", y="tip",               kind="reg", # Options are "scatter", "reg", "resid", "kde", "hex"              data=tips)
sns.pairplot(hue="smoker", # Grouping variable that will produce elements with different colors.             data=tips)
Plot 2 images side by side
figure = plt.figure()figure.add_subplot(1, 2, 1)plt.imshow(image_grey, cmap='gray'), plt.axis("off")figure.add_subplot(1, 2, 2)plt.imshow(image_binarized, cmap='gray'), plt.axis("off")plt.show()
You can even plot more complex grids, check the following for example:
https://seaborn.pydata.org/tutorial.htmlhttps://seaborn.pydata.org/introduction.html
https://seaborn.pydata.org/tutorial.html
https://seaborn.pydata.org/introduction.html
Check out this story colab file, make changes and share it if you found it helpful.
Finally, I created a 3-minute survey to help collect data on what tools and technologies you most use in your Machine Learning projects. Once the data is collected –and if you choose to share your email with me– it will be shared back with you with the goal of identifying trends and best practices.
This survey could help identify areas of improvement and pain points in existing workflows.
Please take a few moments to fill out this survey http://bit.ly/ml-survey-2019