└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # List of various useful resources around Matplotlib 2 | This list is curated by [Teresa Kubacka](http://www.teresa-kubacka.com/) ([pythonviz.blog](https://www.pythonviz.blog/)). If you think a resource should be added, open an issue with your proposal! 3 | 4 | TOC: 5 | - [List of various useful resources around Matplotlib](#list-of-various-useful-resources-around-matplotlib) 6 | * [Cheat sheets](#cheat-sheets) 7 | * [Books](#books) 8 | * [Courses and workshops](#courses-and-workshops) 9 | * [Repositories with examples of complex visualizations](#repositories-with-examples-of-complex-visualizations) 10 | * [Tutorials](#tutorials) 11 | + [Community tutorials](#community-tutorials) 12 | + [Official tutorials you may have missed](#official-tutorials-you-may-have-missed) 13 | * [Resources using the plt-API, but still useful](#resources-using-the-plt-api-but-still-useful) 14 | * [MPL-lore, history and other meta-level material](#mpl-lore-history-and-other-meta-level-material) 15 | - [MPL-compatible modules and extensions](#mpl-compatible-modules-and-extensions) 16 | 17 | ___ 18 | 19 | ## Cheat sheets 20 | - [Official Cheat Sheets](https://github.com/matplotlib/cheatsheets) 21 | - [E2ML chapter by Brandon Rohrer](https://e2eml.school/blog.html#131) 22 | - [How to cite Matplotlib (incl. Bibtex entry)](https://matplotlib.org/stable/users/project/citing.html) 23 | 24 | ## Books 25 | - [Scientific Visualization: Python + Matplotlib by Nicolas P. Rougier](https://github.com/rougier/scientific-visualization-book) 26 | - [Coding for Economists by Arthur Turrell](https://aeturrell.github.io/coding-for-economists/vis-intro.html) 27 | - [Python Data Science Handbook by Jake VanderPlas](https://jakevdp.github.io/PythonDataScienceHandbook/04.00-introduction-to-matplotlib.html) 28 | 29 | ## Courses and workshops 30 | - Anatomy of Matplotlib - a SciPy course developed by the MPL team; a bit old but still very useful [code](https://github.com/matplotlib/AnatomyOfMatplotlib) 31 | - NumFocus Academy - Matplotlib course (beginner) by Nicolas P. Rougier [code](https://github.com/NFAcademy/2021_course_dev-rougier/tree/main/notebooks) 32 | - Beyond the Basics: Data Visualization in Python by Stefanie Molin [code](https://github.com/stefmolin/python-data-viz-workshop) 33 | - PythonMaps Scipy 2022 by Adam Symington [code](https://github.com/symmy596/PythonMaps-Scipy-2022) [video](https://www.youtube.com/watch?v=cjfqCHHp-AE&list=PLYx7XA2nY5Gfxu98P_HL1MnFb_BSkpxLV&index=5) 34 | - Ipywidgets and MPL interactions Scipy 2022 [code](https://github.com/jupyter-widgets/tutorial) [video](https://www.youtube.com/watch?v=1vuI22MkkrY&list=PLYx7XA2nY5Gfxu98P_HL1MnFb_BSkpxLV&index=12) 35 | - Neural Network Visualization by Brandon Rohrer [code](https://github.com/brohrer/autoencoder_visualization) [video](https://end-to-end-machine-learning.teachable.com/p/neural-network-visualization) 36 | - Effectively using Matplotlib by Tim Hoffmann EuroSciPy 2019/2022 [code](https://github.com/timhoffm/using-matplotlib) 37 | - Code, Debug, Reuse this Chart by Artem Kislovsky, AMLD 2024 [code](https://github.com/Kislovskiy/ChartCraftHub/) 38 | 39 | ## Repositories with examples of complex visualizations 40 | - [Lisa-Ho](https://github.com/Lisa-Ho) 41 | - [diego-gonher](https://github.com/diego-gonher/divulgacion/tree/main/visualizaciones) 42 | - [symmy596](https://github.com/symmy596) - geoviz 43 | - [Kaggle: A story told through a heatmap](https://www.kaggle.com/code/tkubacka/a-story-told-through-a-heatmap) 44 | - [sonofacorner](https://github.com/sonofacorner/soc-viz-of-the-week) - sport viz 45 | - [asongtoruin](https://github.com/asongtoruin) 46 | - [rnckp](https://github.com/rnckp) - [SNSF-Data-Starter](https://github.com/rnckp/opendata_snsf-startercode), [Thematic Mapping Switzerland](https://github.com/rnckp/opendata_thematic-mapping) 47 | 48 | ## Tutorials 49 | 50 | ### Community tutorials 51 | - [Engineering for data science - Blog](https://engineeringfordatascience.com/tags/matplotlib/) 52 | - [Plotting subplots in a loop](https://engineeringfordatascience.com/posts/matplotlib_subplots/) 53 | - [Using plt.suptitle](https://engineeringfordatascience.com/posts/matplotlib_subtitles/) 54 | - DataFantic - Blog 55 | - [Stylesheets](https://web.archive.org/web/20240112064712/https://www.datafantic.com/the-magic-of-matplotlib-stylesheets/) 56 | - [Reproducing The Economist style](https://web.archive.org/web/20240119051045/https://www.datafantic.com/making-economist-style-plots-in-matplotlib-2/) 57 | - [Blog of Gianluca Rigoletti](https://grigolet.github.io/index.html#category=matplotlib): 58 | - ridgeplots 59 | - reproducing CERN ROOT stylesheet 60 | - multiple Y axes 61 | - Pythonviz.blog: 62 | - [Various useful snippets](https://www.pythonviz.blog/all_posts_categorized.html#category=matplotlib) 63 | - [Small-multiples charts from scratch](https://www.pythonviz.blog/posts/mpl/mpl_small-multiples_ziplongest.html) 64 | - [Change font family](https://datascienceparichay.com/article/change-font-type-in-matplotlib-plots/) 65 | - How to create custom hatches: [example 1](https://stackoverflow.com/questions/17285154/how-to-fill-a-polygon-with-a-custom-hatch-in-matplotlib) [example 2](https://stackoverflow.com/questions/4745937/how-to-decrease-hatch-density-in-matplotlib?rq=1) [example 3](https://malithjayaweera.com/2020/06/matplotlib-hatch-patterns/). In future releases of Matplotlib there will be a different API to create custom hatches [see discussion](https://github.com/matplotlib/matplotlib/issues/20690) 66 | - [Son of a corner blog](https://www.sonofacorner.com/): 67 | - [Create pretty tables from scratch](https://www.sonofacorner.com/beautiful-tables/) 68 | - [Coordinate systems](https://www.sonofacorner.com/figuring-figures-out/) 69 | - [Rolling average xG charts from scratch](https://www.sonofacorner.com/xg-rolling-plots/) 70 | - [Stacked bars with annotations and icons from scratch](https://www.sonofacorner.com/effective-bar-charts-a-matplotlib-tutorial/) 71 | - [Footbal shot maps](https://www.sonofacorner.com/shot-maps-a-matplotlib-tutorial/) 72 | - [Practical Business Python](https://pbpython.com/): 73 | - [Effectively Using Matplotlib](https://pbpython.com/effective-matplotlib.html) 74 | - [Adam Ruszkowski's blog](https://ruszkow.ski/graphs/) 75 | - [Basic matplotlib Bar Plot Styling](https://ruszkow.ski/graphs/2022-11-01-basic-matplotlib-bar-plot-styling/) 76 | - ["Artist" in Matplotlib - something I wanted to know before spending tremendous hours on googling how-tos](https://dev.to/skotaro/artist-in-matplotlib---something-i-wanted-to-know-before-spending-tremendous-hours-on-googling-how-tos--31oo) 77 | - [plt.xxx(), or ax.xxx(), That Is The Question In Matplotlib](https://junye0798.com/post/plt-xxx-or-ax-xxx-that-is-the-question-in-matplotlib/) 78 | - [Christian Hill's blog](https://scipython.com/blog/) - scientific visualizations and simulations with code examples 79 | - Christian Hill wrote a book ["Learning Python for Scientific Applications"](https://scipython.com/about/the-book/) and the [MPL examples from this book are available online](https://scipython.com/book2/chapter-7-matplotlib/) 80 | - [Islamic Geometric Patterns](https://vamshij.com/blog/2020-01-28-islamic-geometric-patterns/) 81 | - [Don't Use This Code](https://www.dontusethiscode.com/blog/tag/matplotlib.html) 82 | - [Recreate Tufte's weather visualization](https://www.dontusethiscode.com/blog/2023-03-08_tufte-matplotlib.html) 83 | - [Gradient-filled patches and fill-betweens](https://stackoverflow.com/questions/29321835/is-it-possible-to-get-color-gradients-under-curve-in-matplotlib) and [method2](http://pradhanphy.blogspot.com/2014/06/filling-between-curves-with-color.html) 84 | - [A selection of tutorials that recreate R visualizations by Tomas Capretto and Yan Holtz on the Python-Graph-Gallery](https://python-graph-gallery.com/best-python-chart-examples/) 85 | 86 | ### Official tutorials you may have missed 87 | - [How to create custom tables by Tim Bayer](https://matplotlib.org/matplotblog/posts/how-to-create-custom-tables/) 88 | - [Battery Charts by Rithwik Rajendran](https://matplotlib.org/matplotblog/posts/visualising-usage-using-batteries/) - create custom shapes, make them data driven 89 | - [Packed-bubble chart](https://matplotlib.org/devdocs/gallery/misc/packed_bubbles.html) - chart as a class; more circle packing chart than bubble chart 90 | - [Tips on structuring your MPL code by the MPL Project Lead Thomas A Caswell](https://github.com/NFAcademy/2021_course_dev-tacaswell/blob/main/notebooks/01_try_a_function_on.ipynb) 91 | - [yourplotlib - Best practices for domain-specific matplotlib libraries by Colin Carroll, Hannah Aizenman, and Thomas Caswell](https://colcarroll.github.io/yourplotlib/) 92 | 93 | ## Resources using the plt-API, but still useful 94 | - [Matplot GIF on Calmcode](https://calmcode.io/matplot-gif/introduction.html) 95 | - [Matplotlib 3.0 Cookbook by Srinivasa Rao Poladi](https://github.com/PacktPublishing/Matplotlib-3.0-Cookbook) 96 | - [Python Graph Gallery](https://www.python-graph-gallery.com/) - a treasure of visualizations, but unfortunately the APIs used are not consistent 97 | - [Learning Scientific Programming with Python](https://scipython.com/book2/chapter-7-matplotlib/) - contains many interesting examples of mathematical visualizations with accompanying numpy/scipy algorithms, however the MPL API is sometimes inconsistent 98 | - [Minesweeper in MPL](https://jakevdp.github.io/blog/2012/12/06/minesweeper-in-matplotlib/) 99 | - [Advanced MPL with interactivity](https://github.com/jakevdp/matplotlib_pydata2013/tree/master) - 2013 tutorials by Jake Vanderplas 100 | 101 | ## MPL-lore, history and other meta-level material 102 | - [John Hunter and Michael Droettboom explain the design choices they made](https://www.aosabook.org/en/matplotlib.html) 103 | - [Matplotlib Lead Developer Explains Why He Can’t Fix the Docs—But You Can](https://numfocus.org/blog/matplotlib-lead-developer-explains-why-he-cant-fix-the-docs-but-you-can) 104 | - [John Hunter's talk "matplotlib: Lessons from middle age"](https://www.youtube.com/watch?v=e3lTby5RI54) 105 | - [Thoughts on how the MPL API could be more pythonic](https://ryxcommar.com/2020/04/11/why-you-hate-matplotlib/) 106 | - my own NormConf Lightning Talk [How to stop crying when using Matplotlib](https://www.youtube.com/watch?v=vjQIaepijbE) 107 | - [John D. Hunter's IEEE paper introducing Matplotlib](https://doi.org/10.1109/MCSE.2007.55) 108 | - my talk on the Swiss Python Summit 2023, "Did you know Matplotlib could do that?": [video](https://www.youtube.com/watch?v=C6slSZQxYf0) and [slides](https://www.python-summit.ch/recordings/sps23_teresa_kubacka_did_you_know_matplotlib_could_do_that/sps23_teresa_kubacka_did_you_know_matplotlib_could_do_that.pdf) 109 | 110 | # MPL-compatible modules and extensions 111 | 112 | ## Colors 113 | - [glasbey](https://github.com/lmcinnes/glasbey) - Algorithmically create or extend categorical colour palettes 114 | - [tastymap](https://github.com/ahuang11/tastymap) - Easily create, modify and register cmaps, including an interactive widget 115 | 116 | ## Fun 117 | - [ridge_map](https://github.com/ColCarroll/ridge_map) - A library for making ridge plots of... ridges. Choose a location, get an elevation map, and tinker with it to make something beautiful. 118 | 119 | ## Styles 120 | - [opinionated](https://github.com/MNoichl/opinionated) - A stylesheet for newspaper-like visualization style 121 | - [VSCode Intellisense for .mplstyle and matplotlibrc files](https://github.com/yy0931/vscode-mplstyle) 122 | 123 | ## Text and annotations 124 | - [flexitext](https://github.com/tomicapretto/flexitext) - create colorful text strings easily using CSS-like specification 125 | 126 | 127 | --------------------------------------------------------------------------------