[PYTHON] Overview and tips of seaborn with statistical data visualization

seaborn: Python's data visualization library. High level API. Beautiful.

スクリーンショット 2017-04-04 19.18.49.png

0. How to use with matplotlib

1. Style settings

I often use default or "white" for style. Adjust font_scale by looking at the figure.

import seaborn as sns
sns.set(style="white", font_scale=1.3, palette="muted", color_codes=True)

2. Check if you can do what you want with seaborn

View the gallery page of the official doc. (Since the functions that can be used are limited to the following, if you can imagine what you can do with the function name, you do not have to look at the link. You can check the details of the arguments with the help function of ipython.)

Visualization of distribution

function

argument --kde: Kernel density estimation --hist: Histogram --Hue: Distribution estimation by condition

Regression

function

argument --order: Polynomial regression --logistic: Logistic regression --hue: Conditional regression (col, row)

Categorical data

function

3. Other

Read the dataset provided by seaborn

#dataset list: https://github.com/mwaskom/seaborn-data
sns.load_dataset('titanic')

Shaft removal

sns.despine() #Top and right
sns.despine(left=True) #Left too

color palettes

#Current color map
cmap_current = sns.color_palette()
sns.palplot(cmap_current)
#New color map
#reference: http://seaborn.pydata.org/tutorial/color_palettes.html
#Example: key = "set1" (categorical), "Blues" (sequential)
num = 8
cmap = sns.color_palette(key, num)
sns.palplot(cmap)

Recommended Posts

Overview and tips of seaborn with statistical data visualization
Easy data visualization with Python seaborn.
Recommendation of Altair! Data visualization with Python
Implement "Data Visualization Design # 3" with pandas and matplotlib
Data visualization with pandas
Beautiful graph drawing with python -seaborn makes data analysis and visualization easier Part 1
Beautiful graph drawing with python -seaborn makes data analysis and visualization easier Part 2
Analysis of financial data by pandas and its visualization (2)
Analysis of financial data by pandas and its visualization (1)
Statistical hypothesis test of A/B test and required number of data
Visualization method of data by explanatory variable and objective variable
Overview of natural language processing and its data preprocessing
Visualization of data by prefecture
Introduction and tips of mlflow.Tracking
Data processing tips with Pandas
Get rid of dirty data with Python and regular expressions
Using MLflow with Databricks ② --Visualization of experimental parameters and metrics -
Interactive visualization with ipywidgets and Bokeh
Overlay and visualize Geo data and statistical data
Data analysis starting with python (data visualization 1)
Coexistence of Python2 and 3 with CircleCI (1.0)
Data analysis starting with python (data visualization 2)
Implement "Data Visualization Design # 2" with matplotlib
Aggregation and visualization of accumulated numbers
[Basic] Unify everything from tabulation to dashboard creation! Data visualization application development with Python and Dash ~ Overview of Dash, environment construction, sample execution ~
I tried to get and analyze the statistical data of the new corona with Python: Data of Johns Hopkins University
Adjust the bin width crisply and neatly with the histogram of matplotlib and seaborn
A collection of tips for speeding up learning and reasoning with PyTorch
Visualization of latitude / longitude coordinate data (assuming meteorological data) using cartopy and matplotlib
[In-Database Python Analysis Tutorial with SQL Server 2017] Step 3: Data Exploration and Visualization
Sensor data acquisition and visualization for plant growth with Intel Edison and Python
I have 0 years of programming experience and challenge data processing with python
Data pipeline construction with Python and Luigi
Correlation visualization of features and objective variables
Separation of design and data in matplotlib
Read CSV and analyze with Pandas and Seaborn
Example of efficient data processing with PANDAS
Let's visualize the relationship between average salary and industry with XBRL data and seaborn! (7/10)
Practice of creating a data analysis platform with BigQuery and Cloud DataFlow (data processing)
Visualization of CNN feature maps and filters (Tensorflow 2.0)
Convert data with shape (number of data, 1) to (number of data,) with numpy.
Generate and post dummy image data with Django
Coexistence of Fcitx and Zoom ~ With Japanese localization ~
Real-time visualization of thermography AMG8833 data in Python
Interactively visualize data with TreasureData, Pandas and Jupyter.
Script to tweet with multiples of 3 and numbers with 3 !!
Smoothing of time series and waveform data 3 methods (smoothing)
Implementation of TRIE tree with Python and LOUDS
CSV output of pulse data with Raspberry Pi (CSV output)
View details of time series data with Remotte
Wavelet transform of images with PyWavelets and OpenCV
Data cleansing 3 Use of OpenCV and preprocessing of image data
Automatic acquisition of stock price data with docker-compose
Continuation of multi-platform development with Electron and Python
Basics of pandas for beginners ② Understanding data overview
"Learning word2vec" and "Visualization with Tensorboard" on Colaboratory
Example of reading and writing CSV with Python
Get a large amount of Starbucks Twitter data with python and try data analysis Part 1
[Latest method] Visualization of time series data and extraction of frequent patterns using Pan-Matrix Profile
I just wanted to extract the data of the desired date and time with Django