Opacity/alpha as attribute linked to a continuous variable
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- R
- Sterne
- 2.7k
- Forks
- 641
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I am trying to get a continuous transparency according to a continuous variable that also defines the color. I've tried the code suggested in this post https://github.com/ropensci/plotly/issues/389 but I dont manage to do what I want and, in fact, I get very unexpected plots since the colorbar and marker's colors do not match + transparency seems the same for all colors.
require(plotly)
plot_ly(x = rnorm(100), y = rnorm(100), z = rnorm(100),
color = rbeta(100,shape1=1,shape2=1),alpha=.2,
type = "scatter3d", mode= "markers",
colors=colorRamp(c("blue","red")))
I'd like to get low transparency at high color values and vice versa. Is this possible in the currrent version of plot_ly?
plot_ly(x = rnorm(100), y = rnorm(100), z = rnorm(100),
color = rbeta(100,shape1=1,shape2=1),opacity=.2,
type = "scatter3d", mode= "markers",
colors=colorRamp(c("blue","red")))
setting opacity instead of alpha seems to fix the colouring vs colorbar but not the transparency issue.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit den reproduzierbaren plot_ly-scatter3d-Beispielen im Issue und untersuche, wie Farbe, Alpha und Opazität für Marker abgebildet werden. Überprüfe das Verhalten anhand der colorbar und des Erscheinungsbilds der Marker; als erledigt gilt die Aufgabe, wenn eine kontinuierliche Variable sowohl Farbe als auch Transparenz wie angefordert steuern kann, ohne dass die Farben nicht übereinstimmen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- r
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100