Want to learn Seaborn for Data Visualization part02 Tutorial? Hello everyone, today I have write a post related to Seaborn for Data Visualization. this is second part of this blog post. if you want to see first part then please see my blog post. so Let’s start friends:
In this blog post I have covered the Grid, Regression plos, markers and size aspect Ratio.
(NOTE THIS: For detailed please open drive link)
Grid are general types of plots that allow you to map plot types to rows and columns of a grid, this helps you create similar plots separated by features.
Pairgrids is a subplot grid for plotting pairwise relationships in a dataset.
pairplots is a simpler version of PairGrid (you’ll use quite often)
FacetGrids is the general way to create grids of plots based off of a feature:
JointGrids is the general version for jointplot() type grids, for a quick example:
Seaborn has many built-in capabilities for regression plots, however we won’t really discuss regression until the machine learning section of the course, so we will only cover the lmplot() function for now.
lmplot allows you to display linear model, but it also conveniently allow you to split up those plots based off of features, as well as coloring the hue based off of feature.
Let’s explore how this works:
Working with Markers
fig 01) seaborn for data visualization tutorial
lmplot kwargs get passed through to **regplot** which is a more general form of lmplot(). regplots has a scatter_kws parameter that get passed to plt.scatter. So you want to set the parameter in that dictionary, which corresponds (a bit confusingly) to the squared markersize. In other words you end up passing a dictionary with the base matplotlib arguments, in this case, s for size of a scatter plot. In general, you probably won not remember this off the top of your head, but instead reference the documentation.
Size and Aspect
You can use matplotlib’s *plt.figure(figsize=(width,height) * to change the size of most seaborn plots.
You can control the size and aspect ratios of most seaborn grid plots by passing in parameters: size, and aspect. For example:
import pandas as pd import seaborn as sb from matplotlib import pyplot as plt df = sb.load_dataset('iris') sb.distplot(df['petal_length'],kde = False) plt.show()
import pandas as pd import seaborn as sb from matplotlib import pyplot as plt df = sb.load_dataset('iris') sb.stripplot(x = "species", y = "petal-length", data = df) plt.show()
In this article we saw data visualization in python using seaborn function so about this section you have any query then free to ask me