Skip to content

Wrong scaling on ggplotly facet_wrap within shiny #4552

@abbatidanilo

Description

@abbatidanilo

Hello,

I met an issue on the plot result when using the ggplotly on ggplot with facet_wrap. This happens when there is a lot of antigens that is a lot of different plots to wrap together with facet_wrap

This is the code generating the wrong scaling plots:

p <- ggplot(ggdf, aes(x = expression, color = sample_id, group = sample_id)) +
    geom_freqpoly(stat = "density") + 
    facet_wrap(~ antigen, scales = "free", ncol = colonne, nrow = righe) +
    scale_color_manual(values = sample_color)
  
  p <- ggplotly(p = p, originalData = TRUE)

Here colonne = 2 and righe = 12 so we have 24 plots wrapped together.

The same problem happens (but less often) outside shiny implementation and with both originalData parameter setting (FALSE or TRUE)

As you can see below, only the first and the latest row are plotted correctly while all the plots in between are kind of compressed...

newplot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions