There is a new ‘labelalias’ argument in plotly 5.15.0
If I am using the script in the example but add it into streamlit:
import plotly.express as px import pandas as pd import streamlit as st df = px.data.tips() df = ( df[df.day.isin(["Sat", "Sun"])] .groupby(by="day", as_index=False) .sum(numeric_only=True) ) fig = px.bar(df, x="day", y="total_bill") fig.update_xaxes(labelalias=dict(Sat="Saturday", Sun="Sunday")) st.plotly_chart(fig) fig.show()
st.plotly_chart(fig) shows it in streamlit, and the labelalias is not working
the fig.show() opens it in a new tab, where the labelalias is working
I dont know if this is the reason, but I have noticed that
the fig.show() uses plotly.js 2.24.1 to view the plot
while within streamlit, the st.plotly_chart(fig) uses plotly 2.18.1 to view the plot
how can I fix that?
can I control which plotly.js version is used to render the plots?