ggplotly – A Grammar of Graphics implementation in Python/Plotly
https://github.com/bbcho/ggplotly
As a fun project, I decided to try and replicate ggplot2 in plotly and python. I know that plotnine exists, but I like the interactivity of plotly. Let me know what you think. Coverage isn’t 100% but you can do most things. I tried to keep the syntax and naming conventions the same. So this should work:
from ggplotly import * import pandas as pd import numpy as np x = np.linspace(0, 10, 100) y = np.random.random(100) df = pd.DataFrame({'x': x, 'y': y}) x = np.linspace(0, 10, 100) y = np.random.random(100) df2 = pd.DataFrame({'x': x, 'y': y}) ( ggplot(df, aes(x='x', y='y')) + geom_line() + geom_line(df2, aes(x='x', y='y', color='red'), name="Test", showlegend=False )
submitted by /u/turnipemperor
[link] [comments]
/u/turnipemperor
Go to original source