Plotting in Python¶
Python has many nice and useful modules that can be used for plotting, such as:
- Matplotlib - “the grand old man of Python plotting” (Matplotlib gallery)
- Matplotlib Basemap - Matplotlib plugin for visualizing maps in Python (Matplotlib basemap gallery)
- Seaborn - High-level interface for drawing attractive statistical graphics that is built on top of Matplotlib (Seaborn gallery)
- Bokeh - Modern plotting library for static / interactive web-based plots such as graphs, maps, charts etc. (Bokeh gallery)
- Plotly - Modern plotting library for static / interactive web-based plots such as graphs, maps, charts etc. Some features are commercial. (Plotly gallery)
- ggplot - Familiar with doing plots in R using ggplot2? You can use ggplot in Python too! (ggplot examples)
- HoloViews and GeoViews - New! Let the data visualize itself. (see this HoloViews introductory video)
- Modern and powerful visualization libraries built on top of Matplotlib and Bokeh that makes exploring and visualizing your data quicker than ever before
- HoloViews is designed for basic plotting (HoloViews tutorial and HoloViews examples)
- GeoViews is designed for creating nice and interactive maps (GeoViews gallery)
Explore the galleries and examples of different visualization libraries above to learn what’s possible to do in Python.
As you can see from the examples, the plotting possibilities in Python are numerous and rich. Do you need to know them all? Of course not. Not even we do. It is not even rational for trying to use them all, instead you should start by learning to use one of them that suits your needs and then later extend your knowledge and skills to other visualizing libraries when necessary. In our courses, we will be start our plotting experiments with Matplotlib and Plotly that makes it possible to store and show our interactive plots in the web.
Later, in the Automating GIS processes course, we will be learning a little bit of Bokeh as well. We will work in Matplotlib in the Introduction to Quantitative Geology course.
For interactive visualizations in Python, it can be extremely useful to use a specific software called Jupyter that is extensively used nowadays for documenting, presenting and visualizing interactive plots in Python using specific Notebooks. Jupyter Notebook is also installed in our cloud computer instances.