I have a graph and want to add a trace. Before Plotly it underlying was working perfectly but now after I upgraded not anymore:
So this was working fine:
fig[‘data’].extend(figu[j][‘data’])
but now gives the following error:
fig[‘data’].extend(figu[j][‘data’])
AttributeError: ‘tuple’ object has no attribute ‘extend’
I also tried:
fig[‘data’].add_trace(figu[j][‘data’])
and
fig[‘data’].add_traces(figu[j][‘data’])
but still the error: AttributeError: ‘tuple’ object has no attribute …
How to fix this issue? Thanks!
p.s.
This is the full code I am using
import plotly.offline as py
import plotly.graph_objs as go
import cufflinks as cf
def PlotGraph(df_data, df_specs, location, welkerechtsas = ‘’, Titel=‘GrafiekTitel’, XasTitel=‘X-as’, LinkerasTitel=‘Y-as’, RechterasTitel=‘Y-as2’, naam =’’):
# data = df.to_iplot(Grafiekdata)
fig = df_data.iplot(columns=[df_specs.loc[0, ‘Ticker’]], kind=df_specs.loc[0, ‘Type’], title=Titel,
xTitle=XasTitel, yTitle=LinkerasTitel,colors=RGB[0],width = 2, theme=‘white’,asFigure=True)
figu = {}
for j in range(1, len(df_specs)):
figu[j] = df_data.iplot(columns=[df_specs.loc[j, ‘Ticker’]], kind=df_specs.loc[j, ‘Type’],colors=RGB[j],width = 2, asFigure=True)
fig[‘data’].add_traces(figu[j][‘data’])
# fig[‘data’].extend(figu[j][‘data’])