Matplotlib

#124 Spaghetti plot

#124 Spaghetti plot

          A Spaghetti plot is a line plot with many lines displayed together. The problem is that it is really hard to read, and thus provide few insight about the data. This is well documented here.…
Read more
#199 Matplotlib style sheets

#199 Matplotlib style sheets

The matplotlib library comes with several built in styles. It is very easy to use them, and allows to improve the quality of your work. To apply a style to your plot, just add: plt.style.use(“my style”). Here is an example that…
Read more
#370 3D Scatterplot

#370 3D Scatterplot

      The mplot3D toolkit of Matplotlib allows to easily create 3D scatterplots. Note that most of the customisations presented in the Scatterplot section will work in 3D as well. The result can be a bit disappointing since each…
Read more
#270 Basic Bubble plot

#270 Basic Bubble plot

        A bubble plot is very close to a scatterplot. With Matplotlib, we will construct them using the same scatter function. However, we will use the ‘s‘ argument to map a third numerical variable to the size…
Read more
#242 Area chart and faceting

#242 Area chart and faceting

I believe that area charts are especially useful when used through faceting. It allows to quickly find out the different patterns existing in the data. This example relies on a pandas data frame. We have 2 numerical variables (year and…
Read more
#241 Improve area chart

#241 Improve area chart

The chart #240 describes how to make a basic area chart. This page aims to describe a few customisation you can apply to your area chart. It is highly advised to change the default colour of matplotlib. Moreover, it is…
Read more
#240 basic area chart

#240 basic area chart

        An area chart can easily be done using python and matplotlib. Note that there are 2 main functions allowing to draw them. I advise to use the fill_between function that allows easier customisation. The stackplot function…
Read more
#173 Elaborated Venn diagram

#173 Elaborated Venn diagram

          This plot comes from the Matplotlib documentation. I think it describes very well the possibilities offered by the matplotlib library in term of Venn diagram. Thanks to the Matplotlib team for providing such a tool…
Read more
#182 Vertical lollipop plot

#182 Vertical lollipop plot

        When a lollipop plot shows the relationship between a numerical and a categorical variable. I find it better to order the groups on a decreasing order and represent them vertically. Here is how the code works,…
Read more
#181 Custom lollipop plot

#181 Custom lollipop plot

The graph #180 explains how to make a lollipop plot with Matplotlib, whatever the shape of your data. This page aims to describe the customization you can apply to the 3 main parts: the stem, the markers and the baseline. Note…
Read more
#180 Basic lollipop plot

#180 Basic lollipop plot

      This page aims to explain the basic tricks allowing to realize a lollipop plot with matplotlib. Here is a first example with 2 numerical variables, one for each axis. A lollipop plot can be created 1: using…
Read more
#160 Basic donut plot

#160 Basic donut plot

        Here is a basic donut (?doughnut) plot made using the matplotlib library. The trick here is to make a pieplot and add a white circle in the middle of it. Note that another option would be…
Read more
#122 Multiple lines chart

#122 Multiple lines chart

Graphics #120 and #121 show you how to create a basic line chart and how to apply basic customization. This posts explains how to make a line chart with several lines. Each line represents a set of values, for example…
Read more