Plotting the same chart with Matplotlib and ggplot2 | by Thiago Carvalho | Dec, 2020



Great, now that we have all the elements in place, we can customize our chart’s design.

We’ll change the colors of the background, fonts, spines, and annotations, and also change some font sizes.

For Python’s graph, we’ll draw gridlines for our major ticks. For ggplot, we’ll remove the y-axis minor ticks’ gridlines.

In both tools, we have some properties that can be customized when creating the elements and others that need to be customized later.

The main difference is that ggplot has a ‘theme’ that can change most of those properties and keep those changes grouped. With Matplotlib, you have to individually get those properties, which sometimes are sets or lists of attributes that you’ll have to change one by one.

Read More …


Write a comment