Strangely, I am not finding much information anywhere about this error message. The one response I found proposed upgrading to Plotly 5.5. I re-installed the latest version, which is 5.4…apparently:
"(venv) C:\Users\rober\ings>pip install plotly
Requirement already satisfied: plotly in c:\users\rober\ings\venv\lib\site-packages (5.4.0)
Requirement already satisfied: six in c:\users\rober\ings\venv\lib\site-packages (from plotly) (1.16.0)
Requirement already satisfied: tenacity>=6.2.0 in c:\users\rober\ings\venv\lib\site-packages (from plotly) (8.0.1)"
May I ask, what is going on and how can I fix it?
Here is the full Traceback message:
Traceback (most recent call last):
File "C:\Users\rober\ings\checklist.py", line 72, in update_graph
barchart = px.bar(df, y='Amounts', x='Nutrients', text_auto=True,
TypeError: bar() got an unexpected keyword argument 'text_auto'
Below, I pasted the code I am currently using to produce the figure, which is (more or less) straight from the documentation. If I remove the text_auto argument, it produces the graph without the labels.
Changing the argument to “True” produces the same error message.
Thank you for reviewing my question.
@app.callback(
Output(component_id='the_graph', component_property='figure'),
[Input(component_id='nutrient_checklist', component_property='value')]
)
def update_graph(options_chosen):
dff = df[df['Nutrients'].isin(options_chosen)]
print (dff['Nutrients'].unique())
barchart = px.bar(df, y='Amounts', x='Nutrients', text_auto='.2s', title="Controlled text sizes, positions and angles")
barchart.update_traces(textfont_size=12, textangle=0, textposition="outside", cliponaxis=False)
barchart.show()
return (barchart)
Robert