plotly / plotly/plotly.R

facet_wrap: middle row plotted differently from top and bottom facet rows

Offen
#2,167 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

You can see from the attached plot that the middle row of faceted plot is missing the "H" values (y-axis), since the facet labels for the bottom row are covering those "H" values (Note: I'm not showing all of the data in the plot; just what is relevant).

Screen Shot 2022-08-14 at 5 24 44 PM

I cannot provide a full reprex, since the data is private, but my code for that chunk (quarto doc; Rstudio 2022.07.1):

p = annot %>%
  mutate.(`plate row` = `plate row` %>% 
            reorder(`plate row` %>% as.factor %>% as.numeric %>% rev)) %>%
  ggplot(aes(`plate column`, `plate row`, 
             text=`Species name`,
             color=`Strain Viability`, size=`Strain Viability`)) +
  geom_point() +
  scale_x_continuous(breaks=1:12) +
  scale_color_continuous(low='black', high='orange') +
  scale_size_continuous(range = c(1,2)) +
  facet_wrap(~ plate)
ggplotly(p, tooltip='text') %>% 
  layout(autosize = F, width = 800, height = 400)

sessionInfo:

R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] gtsummary_1.6.1   skimr_2.1.4       plotly_4.10.0     tidytable_0.8.0  
[5] data.table_1.14.2 ggplot2_3.3.6     dplyr_1.0.9      

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.2    xfun_0.32           repr_1.1.4         
 [4] purrr_0.3.4         splines_4.2.1       lattice_0.20-45    
 [7] colorspace_2.0-3    vctrs_0.4.1         generics_0.1.3     
[10] htmltools_0.5.3     viridisLite_0.4.0   yaml_2.3.5         
[13] mgcv_1.8-40         base64enc_0.1-3     utf8_1.2.2         
[16] rlang_1.0.4         pillar_1.8.0        glue_1.6.2         
[19] withr_2.5.0         lifecycle_1.0.1     stringr_1.4.0      
[22] commonmark_1.8.0    munsell_0.5.0       gtable_0.3.0       
[25] htmlwidgets_1.5.4   forcats_0.5.1       labeling_0.4.2     
[28] knitr_1.39          fastmap_1.1.0       crosstalk_1.2.0    
[31] fansi_1.0.3         backports_1.4.1     checkmate_2.1.0    
[34] renv_0.15.5         scales_1.2.0        jsonlite_1.8.0     
[37] farver_2.1.1        digest_0.6.29       stringi_1.7.8      
[40] grid_4.2.1          cli_3.3.0           tools_4.2.1        
[43] sass_0.4.2          magrittr_2.0.3      lazyeval_0.2.2     
[46] tibble_3.1.8        crayon_1.5.1        tidyr_1.2.0        
[49] pkgconfig_2.0.3     ellipsis_0.3.2      broom.helpers_1.8.0
[52] Matrix_1.4-1        gt_0.6.0            httr_1.4.3         
[55] R6_2.5.1            nlme_3.1-157        compiler_4.2.1     

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit dem bereitgestellten ggplotly(facet_wrap(...))-Beispiel und untersuchen Sie, wie Facet-Zeilen und y-Achsenbeschriftungen gerendert werden. Reproduzieren Sie die Überlappung mit einem minimalen öffentlichen Datensatz; die Aufgabe ist abgeschlossen, wenn die „H“-Werte der mittleren Zeile sichtbar bleiben und nicht von den Facet-Beschriftungen der unteren Zeile verdeckt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
r
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.