Polar Coordinates with plotnine

1 Introduction

This book provides a gallery of plots using either coord_polar() or coord_radial() with a custom version of plotnine, a Python library implementing the grammar of graphics (Wilkinson 2005) using an API based on that of the R packageggplot2.

Caution

All of the examples on this page require the coord-polar branch of iangow/plotnine. The standard version of plotnine does not include the coord_polar() and coord_radial() functions used here.

I have chosen examples from a number of sources that serve both as targets for development of coord_polar() and coord_radial() and as illustrations of how those functions can be used.

  • In Chapter 2, I use examples from the ggplot2 book, which documents coord_polar() in R’s ggplot2.
  • The socviz package, which provides real-world datasets used in data-visualisation teaching.

The source is at https://github.com/iangow/coord-polar-test.

Caution

All examples require the coord-polar branch of iangow/plotnine. Standard releases of plotnine do not yet include these changes.

Wilkinson, Leland. 2005. The Grammar of Graphics. 2nd ed. Statistics and Computing. Springer.