has2k1 / plotnine

A Grammar of Graphics for Python
https://plotnine.org
MIT License
3.92k stars 210 forks source link

Tutorial ValueError: Unrecognised timezone class #723

Closed angelidis closed 6 months ago

angelidis commented 8 months ago

plotnine.version Out[1]: '0.12.1'

trying to run this tutorial: https://plotnine.readthedocs.io/en/stable/tutorials/miscellaneous-manipulating-date-breaks-and-date-labels.html

import numpy as np

from plotnine import (
    ggplot,
    aes,
    geom_point,
    scale_x_datetime,
    labs,
    theme_set,
    theme_linedraw
)
from plotnine.data import economics

from mizani.breaks import date_breaks
from mizani.formatters import date_format

theme_set(theme_linedraw()) # default theme

economics.head()

(ggplot(economics)
 + geom_point(aes('date', 'psavert'))
 + labs(y='personal saving rate')
)

i get error: "ValueError: Unrecognised timezone class <class 'datetime.timezone'>"

has2k1 commented 8 months ago

Please make sure you have the latest version of plotnine and mizani-0.9.2.