Skip to content
Advertisement

Plotnine (ggplot) : Set the direction legend elements are populated when specifying n rows

I am doing this in plotnine, but hoping ggplotters can assist as well.

Consider the following plot:

JavaScript

enter image description here

I would like the dates to be arranged from left to right, not top to bottom. For example, I want the first row to be Sep-2019, Dec-2019, Mar-2020, Jun-2020, Sep-2020 etc.

I have tried different version of order=1 without success.

Thanks

Advertisement

Answer

As in ggplot2 this could be achieved via the byrow argument of guide_legend. Simply set it to True:

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement