.. _chshgraphsrst: ===================== Cheat Sheet on Graphs ===================== .. only:: html **Links:** :download:`notebook `, :downloadlink:`html `, :download:`PDF `, :download:`python `, :downloadlink:`slides `, :githublink:`GitHub|_doc/notebooks/cheat_sheets/chsh_graphs.ipynb|*` Links, pointers on many plotting libraries. .. code:: ipython3 from jyquickhelper import add_notebook_menu add_notebook_menu() .. contents:: :local: Notebook start -------------- To include graphs in a notebook, many modules require to execute a line before it is imported. `matplotlib `__ .. code:: ipython3 %matplotlib inline Changing style .. code:: ipython3 import matplotlib.pyplot as plt plt.style.use('ggplot') Available styles: .. code:: ipython3 plt.style.available .. parsed-literal:: ['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 `__ .. code:: ipython3 import bokeh.plotting as bplt bplt.output_notebook() .. raw:: html
Loading BokehJS ...
`pyecharts `__ .. code:: ipython3 import pyecharts Change style ------------ Only with `matplotlib `__ .. code:: ipython3 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é `__