plotly / plotly/plotly.R

Define fig size with subplot while height is deprecated in layout

Abierto
#1,613 3 comentarios 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

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

Descripción

When using height argument in layout, I have a warning telling that this argument is deprecated.
I can use height in plot_ly function directly which is very fine.

However, when using subplot, I did not find a convenient way to specify the total height for the assembled panels. Should subplot accept its own height and width arguments ?

If I understand correctly, subplot uses by default the layout from one of the contained plots. It seems to be the case for width and height but I find it confusing because:

  • height is encouraged to be defined outside of the layout function
  • it seems counterintuitive that the size of the panels assembly is controled by the size defined in one subpanel
panel1 = plot_ly(x = 1, y = rnorm(100), height = 600, width = 100) %>% 
           add_trace(type = "violin")
panel2 = plot_ly(x = 1, y = rnorm(100), height = 300, width = 300) %>% 
           add_trace(type = "violin")

# Size of individual panels are respected
panel1
panel2

# Total figure size uses size of one subpanel (one can use 'which_layout' to control which)
subplot(panel1, panel2)
subplot(panel2, panel1)

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 por los puntos de entrada subplot y plot_ly y revisa después cómo layout dimensions y which_layout determinan actualmente el tamaño de la figura ensamblada. Aclara si subplot debería aceptar height y width de forma independiente de sus paneles, y define el comportamiento esperado para dimensiones de paneles en conflicto antes de proponer el cambio.

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

Evaluación

Stack tecnológico
r
Área
data-visualization
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.