[Python] Change colors in python dash plotly theme

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

  1. Stack

    Stack Membro Participativo

    I am currently creating my first plotly dash app and have a question on graph theming:

    I want to use the available plotly_dark theme and only adjust the underlying colors (background and element colors) to custom values. I played around with the ideas provided here: https://plotly.com/python/templates/#saving-and-distributing-custom-themes like this

    import plotly.graph_objects as go
    import plotly.io as pio

    pio.templates["plotly_dark_custom"] = go.layout.Template(
    ...custom definitions here...
    )
    pio.templates.default = "plotly_dark_custom"


    but I was wondering if there is a more intuitive way, e.g. building a child theme from plotly_dark and only override the colors (providing a palette for the colors and define the new background color) afterwards.

    As I am very new to Python my knowledge here is very limited, so I hope you can give me some pointers in the right direction.

    Thank you and let me know if I should provide more details on this request. Stephan

    Continue reading...

Compartilhe esta Página