- Object-oriented way of using matplotlib – 1. The Reasons
- Object-oriented way of using matplotlib – 2. MATLAB style versus OO style
- Object-oriented way of using matplotlib – 3. Basics of Object Oriented APIs
- Object-oriented way of using matplotlib – 4. Multiple Subplots
- Object-oriented way of using matplotlib – 5. Customizing Plots, Legend
- Object-oriented way of using matplotlib – 5. Customizing Plots, Ticks
- Object-oriented way of using matplotlib – 5. Customizing Plots, Colorbar
- Object-oriented way of using matplotlib – 6. Artist and Useful Links
I would like to post a series of articles about object-oriented way of using matplotlib. That explains why we should use that way and how to code like that. The main references are come from the official matplotlib website, “matplotlib.org” and the book, 『Python Data Science Handbook: Essential Tools for Working with Data, Jake VanderPlas, O’REILLY, 2017』.
This is the last article of this series. We have seen a sort of stuffs with OO APIs from the basic objects to the customization. In this post, I will introduce the add_artist and some useful links for matplotlib.
6. Artist and Useful Links
a. add_artist()
In the third post of this series, I’ve quoted the sentence about artist. “Basically everything you can see on the figure is an artist (even the Figure, Axes, and Axis objects)” So, you can draw anything on the figure canvas. Some of drawing elements are part of axes so that it can not be drawn by itself. But independent drawing objects can be drawn freely. You can see how to draw artist objects in below examples. Actually, every examples are shown in matplotlib.org
Here is some example.
The full source code is here. [Link]
b. Useful Links
- Matplotlib Official Documentation
- Books
- Python Data Science Handbook
- Matplotlib-3.0-Cookbook, github [Link]
- Pandas
- etc
Thank you for reading a series of articles.
If you have any opinion or advice about the articles, please leave a comment.