ggplotly() doesn't support multiple colors in axis ticks
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- R
- Star
- 2.7k
- Fork
- 641
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Issue cung cấp một ví dụ ggplotly(p) có thể tái hiện trong một ứng dụng Shiny nhưng không nêu tên tệp hoặc test nào trong repository. Hãy bắt đầu bằng cách lần theo cách ggplotly chuyển đổi các thiết lập axis.text.x của ggplot2, sau đó so sánh đầu ra của ggplot với đầu ra tương tác; công việc được xem là hoàn tất khi các màu được định nghĩa trước xuất hiện trên các nhãn dấu tick của trục x tương tác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- r
- Lĩnh vực
- data-visualization
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100