from plotly.offline import plot, iplot
import plotly.graph_objs as go
import plotly
keys = ["a", "b", "c"]
values = [1, 2, 3]
iplot({"data": [go.Bar(x=keys, y=values)], "layout": go.Layout(title="Sample Bar Chart")})

I tried this code in PyCharm and it works. Also, interactions work with the plot. Strangely the code didn’t work in JupyterLab for me. I think I would need to install the widget.

Image for post

Written by

Senior Data Scientist, tweeting

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store