Description
Take this example whereby I set the exponentformat="SI"
to use SI prefixes for the y-axis:
import plotly.express as px
import pandas as pd
import numpy as np
df = pd.DataFrame({'x': np.arange(1, 5), 'y': np.arange(1, 5)*1e12})
fig = px.line(
df,
x="x",
y="y",
)
fig.update_layout(
yaxis=dict(showexponent="all", exponentformat="SI"),
)
This correctly displays the y-axis using Tera (T) SI prefix units
If you increase the numbers so they are in the Peta (P) range:
df = pd.DataFrame({'x': np.arange(1, 5), 'y': np.arange(1, 5)*1e15})
fig = px.line(
df,
x="x",
y="y",
)
fig.update_layout(
yaxis=dict(showexponent="all", exponentformat="SI"),
)
It stops using SI prefixes on the y-axis and displays the numbers using x10^15: