Plotting in Python#

Python plotting options

Plotting libraries available in Python. Source: https://pyviz.org/overviews/index.html.#

Python has many nice, useful libraries that can be used for plotting. In the figure above, you can see a number of the available plotting library options, along with how they relate to one another. Of the options above, we would like to highlight:

  • Matplotlib: Matplotlib is one of the most widely used Python plotting libraries, sometimes referred to as “the grand old man of Python plotting”. Plot examples can be found in the Matplotlib gallery.

  • Bokeh: Bokeh is a modern plotting library for static and interactive web-based plots including graphs, maps, and charts. Examples can be found in the Bokeh gallery.

  • Plotly: Similar in some ways to Bokeh, Plotly is a modern plotting library for static and interactive web-based plots. Some features are commercial. Example plots are available in the Plotly gallery.

  • Dash: Dash is a Python framework for building analytical web applications. No JavaScript required.

  • ggplot: ggplot is a Python plotting environment for those familiar with creating plots in R using ggplot2. You can use ggplot in Python too! Plot examples can be found in the (ggplot examples).

  • HoloViews and GeoViews: HoloViews and GeoViews aim to let the data visualize itself. Learn more in the 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)

Attention

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 reasonable to use them all. Instead you should start by learning to use one that suits your needs and then later extend your knowledge and skills to other visualization libraries when necessary.

Note

In the Automating GIS processes II course we will be learning a bit of some other plotting libraries not used in the Geo-Python/AutoGIS I course.