[Python] Can you change font of labels in plotly sankey diagrams?

Discussão em 'Python' iniciado por Stack, Abril 8, 2025.

  1. Stack

    Stack Membro Participativo

    I can't find a way to change the font size or colors of the labels (source and target names, not the title) in the Sankey diagram of plotly. Is this even possible?

    In the example below: change font size of fe "Steam 8 MW"

    import plotly.graph_objects as go

    fig = go.Figure(data=[go.Sankey(
    valueformat = ".0f",
    valuesuffix = "MWh",
    node = dict(
    pad = 15,
    thickness = 15,
    line = dict(color = "black", width = 1),
    label = ["Steam 8 MW", "Raff 5 MW", "FAB 3 MW"],

    color = "blue"
    ),
    link = dict(
    source = [0, 0],
    target = [1, 2],
    value = [5, 3]
    ),

    )

    ])

    Continue reading...

Compartilhe esta Página