Cheat Sheet on Graphs¶

Links, pointers on many plotting libraries.

In [1]:
from jyquickhelper import add_notebook_menu
add_notebook_menu()
Out[1]:
run previous cell, wait for 2 seconds

Notebook start¶

To include graphs in a notebook, many modules require to execute a line before it is imported.

matplotlib

In [2]:
%matplotlib inline

Changing style

In [3]:
import matplotlib.pyplot as plt
plt.style.use('ggplot')

Available styles:

In [4]:
plt.style.available
Out[4]:
['bmh',
 'classic',
 'dark_background',
 'fast',
 'fivethirtyeight',
 'ggplot',
 'grayscale',
 'seaborn-bright',
 'seaborn-colorblind',
 'seaborn-dark-palette',
 'seaborn-dark',
 'seaborn-darkgrid',
 'seaborn-deep',
 'seaborn-muted',
 'seaborn-notebook',
 'seaborn-paper',
 'seaborn-pastel',
 'seaborn-poster',
 'seaborn-talk',
 'seaborn-ticks',
 'seaborn-white',
 'seaborn-whitegrid',
 'seaborn',
 'Solarize_Light2',
 'tableau-colorblind10',
 '_classic_test']

bokeh

In [5]:
import bokeh.plotting as bplt
bplt.output_notebook()
Loading BokehJS ...

pyecharts

In [6]:
import pyecharts

Change style¶

Only with matplotlib

In [7]:
import matplotlib.pyplot as plt
plt.style.use('ggplot')

If you want to draw a...¶

Basic graph as images¶

  • maplotlib
  • pandas.DataFrame.plot

Basic graphs as javascript¶

  • bokeh
  • pygal
  • C3.js
  • pyecharts

Animated graphs¶

  • bokeh

Maps¶

  • cartopy
  • folium

Statistical graphs¶

  • seaborn

Networks¶

  • networkx
  • graphviz

More¶

  • 10 plotting librairies

Notebooks and Python¶

  • Graphes - énoncé (French)
  • Rappel de ce que vous savez déjà mais avez peut-être oublié
In [8]: