Explanation of Seaborn Common Graphics

Source: Internet
Author: User
Keywords seaborn seaborn tutorial seaborn python
Seaborn package is an enhanced version of Matplotlib, which needs to be installed before it can be used.
All graphics plt.show You can also use the create canvas below
fig,ax= plt.subplots () a canvas
fig,(ax1,ax2) =  plt.subplots (ncols = 2) ා two canvases
1) Single feature statistical chart countplot
sn.countplot ( train.mnth )#Discrete features can be used to describe the number of sample points.
2) Distplot of single feature statistics
sn.distplot ( train.cnt.values , bins = 50, KDE = true) ා continuous features can be used, bins = 50 is divided into 50 columns, KDE = true shows the core density line. If the tail of the figure is very special, it may be a singular point (outlier, noise point), consider removing it.
3) Double feature violin diagram
sn.violinplot (data = train [['yr ','cnt']], x = yr, y = CNT) # displays the data distribution and its probability density, the black bar in the middle represents the quartile range, the fine black line extending from it represents the 95% confidence interval, and the white dot is the median.
4) Double characteristic box diagram
sn.boxplot (data = train, x = yr, y = CNT), also known as box chart, box chart or box line chart, is a kind of statistical chart used to display the data of a group of data dispersion. It shows the order from top to bottom: abnormal value (may not be), maximum value, upper quartile, median, lower quartile, minimum value, abnormal value (sometimes not, and pay special attention if any).
5) Double characteristic bar graph
fig,(ax1,ax2) =  plt.subplots (ncols = 2) ා one canvas, two axes
sn.barplot (data = train, x = Holiday ', y = cnt', hue = weatherset ', ax = ax1) ᦇ hue = weatherset', which is distinguished by weatherset
sn.barplot (data = train, x = working day ', y = cnt', hue = season ', ax = AX2) # hue = season', which can be distinguished by season
6) Double feature line graph
fig,ax =  plt.subplots ()
sn.pointplot (data=train[['dayofyear','cnt', 'yr']],x='dayofyear',y='cnt',hue='yr',ax=ax)
#Hue ='yr 'refers to the year of distinction. Hue refers to color
ax.set (title="dayly distribution of counts")
plt.show ()
7) Relational thermodynamic diagram
corrMatt = train[["temp","atemp","hum","windspeed","cnt"]].corr()
mask =  np.array (corrMatt)
mask[ np.tril_ indices_ from(mask)] = False
sn.heatmap (corrMatt, mask=mask,
vmax=1, square=True,annot=True)
plt.show ()
8) Double characteristic scatter plot
sn.scatterplot (x= train.GrLivArea Y= train.SalePrice )
plt.title ("looking for outliers") (drawing title)
plt.sho
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.