I’m new to ploytly. I’m experiencing some issues (blank plot) using offline plot options with plotly and python. I followed some suggestions as in https://community.plotly.com/t/offline-mode-in-jupyter-notebook-shows-blank-graphs/1860. but without sucess. My plotly version is
1.12.19 and my phyton version is
I did some modifications in the Color Palette for Bar Chart example contained in https://plot.ly/python/horizontal-bar-charts/. My online plot works fine when I try :
fig = go.Figure(data=traces, layout=layout) plotly.iplot(fig, filename='bar-colorscale')
However, if I try :
fig = go.Figure(data=traces, layout=layout) plotly.offline.iplot(fig, filename='bar-colorscale')
The result is a blank plot, with plotly api and x and y axis :
I tried a simple test with plotly.offline.plot using :
trace = go.Bar(x=[2, 4, 6], y= [10, 12, 15]) data = [trace] layout = go.Layout(title='A Simple Plot', width=800, height=640) fig = go.Figure(data=data, layout=layout) plotly.offline.plot(fig, filename='a-simple-plot')
And it works perfectly. So I believe that the issue is in
fig. In the Color Palette for Bar Chart example,
fig has a list of
traces (stacked bar). But in the test example above,
trace is a single graphic object (go) element.
Is there a way to make a offline plot from a trace that contains many graphic objects (as showed in the Color Palette for Bar Chart example )? Or maybe I’m doing something else wrong ?