plotly / plotly/plotly.R

Monochrome Heatmap + plotly removes the heatmap color

Abierto
#1,295 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

ggplotly
Lenguaje dominante
R
Estrellas
2.7k
Forks
641
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hello, I had previously described an issue I faced with heatmaply here: https://stackoverflow.com/questions/50976183/heatmaply-color-when-all-elements-are-the-same-value, and one of the answers pointed out the fact that this was a plotly bug, not a heatmaply bug.

Essentially, when a heatmap for a matrix where all the values are the same (so a monochrome heatmap) is passed to ggplotly, the resulting plotly plot removes the color and renders it all in gray.

library(ggplot2)
library(plotly)
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
library(viridis)
#> Loading required package: viridisLite
x <- rep(1, 10)
g <- ggplot(data.frame(x), aes(x=x, y=x, fill=x)) + 
    geom_tile() + 
    scale_fill_viridis(limits = c(0, 1))
g

Created on 2018-06-29 by the reprex package (v0.2.0.9000).

When ggplotly(g) is run, the output is as follows:

I tried attaching this to the reprex but could not, as reprex does not seem to play well with plotly objects, or I am missing something

As you can see, plotly removes the coloring in the heatmap. What is the problem here?

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza ejecutando el ejemplo de R proporcionado con ggplot2 y plotly, comparando el mapa de calor coloreado de ggplot con el resultado de ggplotly(g). Rastrea el comportamiento de conversión para una matriz cuyos valores son todos idénticos; se considera terminado cuando ggplotly conserva el color del mapa de calor en lugar de representar las teselas en gris.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
plotly, r
Área
data-visualization
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.