Skip to content

SI prefixes don't display Peta (P) correctly #4787

@joshlk

Description

@joshlk

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

newplot(1)

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:

newplot(2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy