ggplotly() doesn't support multiple colors in axis ticks
Nessuno ha ancora preso questa issue.
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hello and thanks for the great job you did by making this really useful package. I just want to report an issue that appears when I need to colour the axis text of a plot with pre - defined colours. Below you can see the R code to build a really simple shiny app. If I plot my graph with the standard ggplot() function the names of the x axis result colored, but if I use the function ggplotly() to make my plot interactive, the text of the x axis remains black (the functions recognizes the arguments "angle" and "hjust" but not "col").
Thanks in advance for the availability.
Nico
library(ggplot2)
library(plotly)
library(shiny)
### UI
ui <- fluidPage(
fluidRow(
column(width = 8,
plotlyOutput(outputId = "plot",
height = "600px"))))
### SERVER
server <- function(input, output) {
output$plot <- renderPlotly({
mpg_s <- mpg[c(1, 19, 38), ] # subset to pick just 3 rows
col <- c("red", "green", "blue")
p <- ggplot(data = mpg_s,
aes(x = manufacturer, y = hwy)) +
geom_point() +
theme(axis.text.x = element_text(size = 20,
angle = 90,
hjust = 1,
colour = col))
ggplotly(p)
})
}
### LUNCH APP
shinyApp(ui = ui, server = server)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
L’issue fornisce un esempio riproducibile di ggplotly(p) in un’app Shiny, ma non indica alcun file del repository o test. Inizia tracciando il modo in cui ggplotly converte le impostazioni axis.text.x di ggplot2, quindi confronta gli output ggplot e interattivo; il lavoro è completato quando compaiono colori predefiniti sulle etichette dei tick dell’asse x interattivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- r
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100