ColorScale Will Not Change If Specifying with colorscale = c('hexcode1', 'hexcode2')
Personne n'a encore pris cette issue.
- Langage dominant
- R
- Étoiles
- 2.7k
- Forks
- 641
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hi,
After following the guide here, https://plotly.com/r/3d-scatter-plots/, I found that, when specifying color scale with colorscale = c('hexcode1', 'hexcode2') will not have changes to the color scale, yet the default palette names such as 'Rainbow' will work. In this case, it would not be possible to self-define the 2 end points of the color scale. Please feel free to run the R codes below to see what I mean.
library(dplyr)
library(plotly)
fig <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec,
marker = list(color = ~mpg,
#colorscale = c('#FF0000', '#00FF72'),
#colorscale ='Rainbow',
colorscale = c('#132B43', '#56B1F7'),
showscale = TRUE))
fig <- fig %>% add_markers()
fig <- fig %>% layout(scene = list(xaxis = list(title = 'Weight'),
yaxis = list(title = 'Gross horsepower'),
zaxis = list(title = '1/4 mile time')),
annotations = list(
x = 1.13,
y = 1.05,
text = 'Miles/(US) gallon',
xref = 'paper',
yref = 'paper',
showarrow = FALSE
))
fig
Just wondering if this is a bug or may be there needs some updates to the guide?
Thanks,
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par exécuter l’exemple R fourni dans le guide du nuage de points 3D et comparez la colorscale hexadécimale personnalisée avec la palette Rainbow fonctionnelle. Suivez la manière dont colorscale est transmise par plot_ly() et add_markers(). C’est terminé lorsque les deux couleurs d’extrémité spécifiées contrôlent visiblement la colorscale des marqueurs, ou lorsque le guide documente la syntaxe prise en charge.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- r
- Domaine
- data-visualization
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100