Article Directory
一、seaborn
1 Introduction
seaborn is matplotlib extension and expansion, if you know matplotlib, you will have mastered most of Seaborn.
seaborn particular visualized as the target data.
Matplotlib with the greatest difficulty is the default of various parameters, while seaborn completely avoids this problem.
2.as
import seaborn as sns
3. Website
http://seaborn.pydata.org/examples/index.html
http://seaborn.pydata.org/api.html
Second, the data is loaded
1. own data
Load Pandas DataFrame.
2.Seaborn sample data set (snsn.load_dataset ())
September 8, 2018 13:33:16 silly spat Reads: 2408
When we believe in learning GroupBy, or PivotTable, you are likely to encounter similar to the following line of code:
import seaborn as sns
planets = sns.load_dataset('planets')
Then you can find planets have stored the data, then the data is in the end come from?
We look load_dataset the docstring:
In [54]: sns.load_dataset??
Signature: sns.load_dataset(name, cache=True, data_home=None, **kws)
Source:
def load_dataset(name, cache=True, data_home=None, **kws):
"""Load a dataset from the online repository (requires internet).
Parameters
----------
name : str
Name of the dataset (`name`.csv on
https://github.com/mwaskom/seaborn-data). You can obtain list of
available datasets using :func:`get_dataset_names`
cache : boolean, optional
If True, then cache data locally and use the cache on subsequent calls
data_home : string, optional
The directory in which to cache data. By default, uses ~/seaborn-data/
kws : dict, optional
Passed to pandas.read_csv
"""
We can see the first line of the docstring illustrates this function is to load the data set from the online repository (requires internet).
URL: https://github.com/mwaskom/seaborn-data
sns.heatmap()
square = Ture, forced the box, but the data is too long will huddle together
square = False, automatically adjusting the length of more rectangular data, not crowded together
reference:
https://www.jianshu.com/p/5ff47c7d0cc9