Graph Your Data With Python and ggplot (Summary)
Using ggplot
in Python allows you to build data visualizations in a very concise and consistent way. As you’ve seen, even complex and beautiful plots can be made with a few lines of code using plotnine.
In this course, you’ve learned how to:
- Install plotnine and Jupyter Notebook
- Combine the different elements of the grammar of graphics
- Use plotnine to create visualizations in an efficient and consistent way
- Export your data visualizations to files
If you want to learn more about grammars of graphics, you can check out the following resources on the topic:
- The Grammar of Graphics by Leland Wilkinson
- A Layered Grammar of Graphics by Hadley Wickham
Leland Wilkinson’s book is a standard lecture on this topic. Hadley Wickham’s paper, which you can read as a free PDF online, describes the basics for the implementation of a grammar of graphics in the R library ggplot2 that serves as the base for Python’s plotnine
library.
If you want to learn more about building data visualizations in Python and the underlying libraries that plotnine
relies on, then you can check out:
- Data Visualization With Python (Learning Path)
- Pandas for Data Science (Learning Path)
Also, make sure to consult the plotnine
documentation and take a look at the data visualization learning resource for R’s ggplot2
library, which plotnine
is based on.
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
00:00
You’ve made it all the way to the end of this course about using ggplot
in Python, where you learned how to visualize your data using the plotnine library, which is a port of the ggplot2
library from the R programming language to Python.
00:14 You’ve covered a bunch of topics. We started off just talking about what is a grammar of graphics and what is a layered grammar of graphics that is applied here in programming. Then you got set up with installing plotnine, either using Anaconda or a virtual environment.
00:29 Then you started to learn about the different layers that are present in a grammar of graphics. You learned about the data layer, you learned about the aesthetics layer, and also about the geometric objects layer—these three being the most important ones that you always have to arrange if you want to display some data with plotnine.
00:48 And then you learned about a couple of other layers as well: for example, the statistical transformations you can apply, or also scales, as well as coordinate systems.
00:58 And then you also learned about different themes that you can put on top of this just to give your graphs a different look and feel. Finally, you learned how you can export those graphs that you created to save them as separate files.
01:11 This sums up the course about working with plotnine in Python, and check out the description on this lesson for a couple of links that lead you forward for your next steps if you want to learn more about the grammar of graphics or data visualization with Python. Thanks for joining! My name is Martin, and have a good day!
Become a Member to join the conversation.