2

I've been using plotnine to plot in Python and I would like to set up a default line size for all plots. Unfortunately, changing line inside my custom theme only affects background elements.

In R using ggplot it is possible to run update_geom_defaults("line", list(size = desired size)) to get the desired behaviour. Is there such an alternative for plotnine?

S -
  • 349
  • 3
  • 19

1 Answers1

1

I've finally found the solution to this. As indicated by the Plotnine API all geoms have an attribute called DEFAULT_AES containing the default values used for plotting. New default values can be set by changing the values of this dictionary. For instance, to set a new line size one can run:

import plotnine as p9
p9.geoms.geom_line.DEFAULT_AES['size']=desired_size
S -
  • 349
  • 3
  • 19