4

I'm trying to make an interactive bar-plot, where in i can have a drop-down to change the hue of a visualization. For example,

sns.barplot(x=df['sex'],y=df['total_bill'],hue=df['smoker'])
sns.barplot(x=df['sex'],y=df['total_bill'],hue=df['time'])

Smoker Time

I basically want to combine the 2 plots into 1, where i can have a button-like option to change the hue. Im thinking this can be done with plotly or bokeh.

  • 1
    https://plot.ly/python/dropdowns/ this might help to my knowledge!! – KcH Sep 13 '19 at 06:22
  • Spent an hour but can't seem to figure out how. I'll update the post with plotly codes once i'm done trying. Thanks! – Benj Cabalona Jr. Sep 13 '19 at 08:20
  • 1
    Possibly [this answer](https://stackoverflow.com/questions/41671867/embedding-figure-type-seaborn-plot-in-pyqt-pyqtgraph/41677416#41677416) can help. The question is very broad, so it's hard to identify any actual problem and hence provide an answer here. – ImportanceOfBeingErnest Sep 13 '19 at 13:11

1 Answers1

1

This might help someone in the future so i'll put it here. I found the answer using this wonderful library https://altair-viz.github.io/