Only a single geom_pointrange() layer showing when using ggplotly()
Đang mở
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ả
I am trying to use ggploty to show a ggplot with two pointrange layers. This works in ggplot but not when I use ggplotly. I am not sure if this is possible to do?
# Create some dummy data
``` r
dat<-dplyr::tibble("kvotealtternativ"=c(15,30,45),
"prognose"=c(68.9,60.6,52.4),
"lower50" =c(62,54,45),
"lower75"=c(56.7,48.8,40.9),
"upper50"=c(76,66,58),
"upper75"=c(82.2,73.5,64.9))
# Create the ggplot with two layers - 75% CI and 50% CI
p=dat |>
ggplot2::ggplot()+
ggplot2::geom_pointrange(mapping=ggplot2::aes(x=kvotealtternativ, y=prognose, ymin=upper75, ymax=lower75), fatten=1, size=3, color="darkred")+
ggplot2::geom_pointrange(mapping=ggplot2::aes(x=kvotealtternativ, y=prognose, ymin=upper50, ymax=lower50), fatten=1, size=3, color="darkorange")+
ggplot2::geom_point(ggplot2::aes(kvotealtternativ,prognose), colour="black", size=6)+
ggplot2::labs(x="Uttak", y="Prognose")+
ggplot2::geom_hline(yintercept=65, linetype=2)+
ggplot2::theme_classic()+
ggplot2::theme(axis.text.x = ggplot2::element_text(color = "grey20", size = 15, face = "plain"),
axis.text.y = ggplot2::element_text(color = "grey20", size = 15, face = "plain"),
axis.title.x = ggplot2::element_text(color = "grey20", size = 20, face = "plain"),
axis.title.y = ggplot2::element_text(color = "grey20", size = 20, face = "plain"))
# This is the desired plot
p

# But when I use ggplotly the 75% layer is not displayed
plotly::ggplotly(p, tooltip="none")

Created on 2023-10-19 with reprex v2.0.2
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
Bắt đầu bằng cách chạy reprex R được cung cấp và so sánh đầu ra của ggplot2 với plotly::ggplotly(p), tập trung vào hai layer geom_pointrange(). Truy vết entry point của ggplotly và xác định lý do layer 75% bị thiếu; được xem là hoàn thành khi cả hai layer pointrange đều được render trong plot đã chuyển đổi và các phần tử plot hiện có vẫn nguyên vẹn.
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ó
- 3/5
- Thời gian dự kiến
- 1-2 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
- 42/100