I am trying to use Plotnine: https://plotnine.readthedocs.io/en/stable/index.html with PyScript. My code looks as follows:
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<py-env>
- scipy
- matplotlib
- plotnine
- pandas
- mizani
- statsmodels
</py-env>
<body>
<py-script>
from plotnine import ggplot, geom_point, aes, stat_smooth, facet_wrap
from plotnine.data import mtcars
print(ggplot(mtcars, aes('wt', 'mpg', color='factor(gear)'))
+ geom_point()
+ stat_smooth(method='lm')
+ facet_wrap('~gear'))
</py-script>
</body>
</html>
The Plotnine syntax is a direct copy-paste from the Plotnine main page.
However, when I open this HTML, at first everything loads just fine with no errors, but instead of the plot the following Pandas warnings are printed (yes, twice):
/lib/python3.10/site-packages/plotnine/utils.py:371: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. /lib/python3.10/site-packages/plotnine/utils.py:371: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
What am I doing wrong?