Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[BUG]: Changing marker.colorscales with a dropdown menu doesn't work for most colors

Offen
#5,462 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@emilykl arbeitet bereits daran.

Seit 14.1.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

bug

Changing marker.colorscales with a dropdown menu doesn't work for most colors, as can be seen in the example below:

import numpy as np
import itertools as it
from plotly import graph_objs as go

x, y = np.array([*zip(*it.combinations(range(20), 2))])
z = np.random.random(len(x))
colors = ['Brwnyl', 'Agsunset', 'Sunsetdark', 'Magenta', 'Sunset', 'Purpor', 'Purp', 'Tealgrn', 'Teal', 'Bluyl', 'Aggrnyl', 'Emrld', 'Darkmint', 'Blugrn', 'Mint', 'Pinkyl', 'Peach', 'Oryel', 'Redor', 'Burgyl', 'Burg', 'tempo', 'amp', 'speed', 'matter', 'algae', 'dense', 'deep', 'gray', 'ice', 'solar', 'haline', 'thermal', 'turbid', 'YlOrRd', 'YlOrBr', 'YlGnBu', 'YlGn', 'Reds', 'RdPu', 'RdBu', 'Purples', 'PuRd', 'PuBuGn', 'PuBu', 'Oranges', 'OrRd', 'Greys', 'Greens', 'GnBu', 'BuPu', 'BuGn', 'Blues', 'Rainbow', 'Jet', 'Hot', 'Electric', 'Bluered', 'Blackbody', 'Turbo', 'Plasma', 'Magma', 'Inferno', 'Cividis', 'Viridis', 'Plotly3', 'Portland', 'Picnic', 'Earth', 'Tropic', 'Tealrose', 'Temps', 'Geyser', 'Fall', 'Armyrose', 'oxy', 'curl', 'delta', 'balance', 'Spectral', 'RdYlGn', 'RdYlBu', 'RdGy', 'PuOr', 'PiYG', 'PRGn', 'BrBG']

fig = go.Figure()
fig.add_scatter3d(
    x=x, y=y, z=z,
    mode="markers",
    marker=dict(
        line=dict(width=0.1, color="black"),
        size=z*10,
        color=z,
        colorscale="Turbo",
        showscale=True,
    ),
)
fig.update_layout(
    updatemenus=[
        dict(
            buttons=[
                dict(label=color, method="restyle", args=[{
                    "marker.colorscale": color,
                }, [0]])
                for color in colors
            ],
        ),
    ],
)
fig.show()

Note that "Turbo" works when setting the figure, but not when updating it with a button.
Using Python=3.14.2 and Plotly=6.5.1.

Vorherrschende Sprache
Python
Sterne
18.8k
Forks
2.8k
Ø Merge
13 Std. 28 Min.
Gemergte PRs (30 T.)
20

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus plotly/plotly.py

Alle Issues in plotly/plotly.py

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.