Legend "entrywidth" and "entrywidthmode" parameters appear to be ignored when knitting Rmd to HTML
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- r
- Área
- data-visualization
Línea de trabajo
Empieza reproduciendo el ejemplo usando plot_ly y layout con legend entrywidth y entrywidthmode; después, haz knit del Rmd a HTML y compara distintos valores de los parámetros. Comprueba el archivo adjunto rel_table_filtered.csv y el comportamiento de la leyenda renderizada; se considera terminado cuando estos parámetros controlen visiblemente las dimensiones del cuadro de la leyenda en la salida generada con knit.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I'm trying to use plotly to plot several stacked barplots of the same size each. Each barplot has legend elements of increasing size, and I would like to set the dimensions of the legend box, instead of the legend box being the size of the longest legend element. I've found the parameters entrywidth and entrywidthmode and tried using them to set this graphic setting, but the plots look exactly the same independently on what values I use.
The data looks like this:
> head(rel_table_filtered)
Class Relative_frequency Sample
3 Bacteria;Bacteria;Unclassified 0.001547047 ileum_A
4 Bacteria;Bacteria;Actinobacteriota 0.137521410 ileum_A
5 Bacteria;Bacteria;Bacteroidota 0.111055859 ileum_A
8 Bacteria;Bacteria;Desulfobacterota 0.011989613 ileum_A
9 Bacteria;Bacteria;Firmicutes 0.707497652 ileum_A
11 Bacteria;Bacteria;Proteobacteria 0.025857782 ileum_A
The function simplified function I'm using to plot the barplots is the following. Wheter I put 0.9, 0.5, 1/8, etc, on the entrywitdthmode parameter, the plot looks the same. I've also tried with autosize=FALSE and with height and width parameters on the plot_ly function, without success.
fig <- plot_ly(rel_table_filtered, type = "bar", y = ~Sample, x= ~Relative_frequency, color = ~Class, orientation = "h") %>%
layout( barmode = 'stack', xaxis = list(title = ''), yaxis = list(title = '%'), autosize = T, legend = list(entrywidthmode = "fraction", entrywidth = 0.9), hoverlabel = list(namelength=-1) )
fig

I'm attaching the rel_table_filtered.csv file:
rel_table_filtered.csv
Thanks in advance!
- Lenguaje dominante
- R
- Estrellas
- 2.7k
- Forks
- 641
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de plotly/plotly.R
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Data gets dropped in add_trace and consequently points have the wrong color if NA is present Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
save_image Error Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
Todos los issues de plotly/plotly.R
Issues similares
-
documentation pkg infrastructure
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
epiverse-trace/epiparameter#511 ·
-
Stray pipe in eventRemarks Abiertofunction:write_dwc
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Urgent request: Due to vulnerabilities move to API version 12.6.1 (12.6.2 eventually) or 13.1.1 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
jbkunst/highcharter#849 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
r-lib/pkgdepends#485 · 3 comentarios ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100