hello, guys, recently I upgrade to plotly 3.5.0 in order to use FigureWidegt feature, previous version was 2.4.0. I didn’t go far with 3.5.0 because when i ran my previous codes it gave me a TypeError
paste part of code :
import plotly as py
import plotly.graph_objs as go
import plotly.figure_factory as ff
subtitles = [‘A’,‘B’]
fig = py.tools.make_subplots(rows=2, cols=1, subplot_titles=subtitles)
trace1 = go.Scatter(x=[1, 2, 3], y=[3, 1, 6])
fig.append_trace(trace1,1,1)
data_matrix = [[‘Country’, ‘Year’, ‘Population’],
[‘United States’, 2000, 282200000],
[‘Canada’, 2000, 27790000],
[‘United States’, 2005, 295500000],
[‘Canada’, 2005, 32310000],
[‘United States’, 2010, 309000000],
[‘Canada’, 2010, 34000000]]
table = ff.create_table(data_matrix)
table_trace = table[‘data’][0]
fig.append_trace(table_trace, 2, 1)
fig[‘layout’][‘xaxis2’] = dict(fig[‘layout’][‘xaxis2’], **table[‘layout’][‘xaxis’])
fig[‘layout’][‘yaxis2’] = dict(fig[‘layout’][‘yaxis2’], **table[‘layout’][‘yaxis’])
it was ok under plotly 2.4, but after I upgraded, it goes with a typeError:
fig[‘layout’][‘xaxis2’] = dict(fig[‘layout’][‘xaxis2’], **table[‘layout’][‘xaxis’])
TypeError: type object argument after ** must be a mapping, not XAxis
Please advise T.T
my environment is python3.6 with Pycharm on Mac