12 Data Visualization with GGPlot2 (R) and MatPlotLib (Python) Cheat Sheet

Kylie Brothers

Motivation

Throughout undergraduate, graduate, and professional careers, the two most widely used statistical languages are Python and R. Both of these languages have many similarities, but can have very differing syntaxes and coding implementations.

For this project, it was important to create a cheat sheet so an individual can easily navigate both languages and transfer knowledge learned in this course to Python. Therefore, I created a cheat sheet for GGPlot2 in R, which we learned extensively in class, and MatPlotLib in Python, which has been the primary visualization package used in my undergraduate and graduate careers. Both of these packages have their own cheat sheets, respectively, but they are formatted differently and it can be hard to parse through both of them to gain the exact line(s) of code you need when making comparisons or migrating code to another programming language.

Link to cheat sheet: https://github.com/kylie-brothers/GGPlot2-and-MatPlotLib-Cheat-Sheet/blob/main/GGPlot2%20and%20MatPlotLib%20Cheatsheet.pdf

If I Had More Time…

If I had more time, or the next time I create a cheat sheet to navigate these packages, I would include faceting, subplots, and tick markers. In addition, I think it would be useful to also have a comparison for GGPlot2 (R) and Seaborn (Python); or MatPlotLib (Python) and Seaborn (Python). All three of these packages are heavily used for visualization and having an easy to access cheat sheet for all of these languages and packages would make it a lot quicker and easier to transverse any coding that is trying to be implemented.