[Bug] Geom_smooth graphical error when converting from ggplot to plotly using ggplotly
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,
I have a graphical issue which shows up when converting a ggplot2 plot with geom_smooth to a plotly plot:
as you can see in the plotly plot, an extra nonsensical confidence interval ribbon gets generated below the fitted lines.
When I lower the confidence interval from 0.95 to 0.80 the ribbon in correctly displayed:
However this is not the confidence interval I need.
I know it has something to do with plotly as this is my ggplot (with confidence interval 0.95) used to generate the first bugged image:
Here is the (anonymized) code used to generate the plot(s):
p16 <- ggplot(data= df, order = rownames(x)) +
geom_point(data= df,aes(x=x.ordered, y=(mean1), color=paste("Number = ", Number))) +
geom_point(data= df,aes(x=x.ordered, y=(mean2), color=paste("Number2 = ", Number))) +
geom_smooth(data = dfcopy, aes(x=x.ordered, y=mean2, color=Number, group=Number), method="loess", level=0.95) +
ylab("y") + scale_y_continuous(limits=c(0, 1)) + xlab(paste("x")) +
theme_bw() + theme(plot.title = element_text(hjust = -.5, face="bold"), axis.title.x = element_text(hjust = 1, size = 14, face="bold"), axis.text.x = element_text(angle = 90, hjust = 1), axis.title.y = element_text(size = 14, face="bold")) +
ggtitle("") + labs(color = "\n\nType of data point: " )
p16 <- p16 + scale_color_manual(values=c("#B24745FF", "#DF8F44FF","#00A1D5FF", "#6A6599FF", "#00A1D5FF", "#6A6599FF"))
gp16 <- ggplotly(p16, tooltip=c("text")) %>% layout(legend = list(orientation = "v",xanchor = "center", x = 1.2), title = list())
Unfortunately I can't provide data or the axes, I also removed the ggplot text variable due to anonymous data.
If someone might know a solution to this graphical error, it would be greatly appreciated.
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
Không có tệp repository hoặc test nào được nêu tên, và người báo cáo không thể cung cấp dữ liệu hay các trục. Hãy bắt đầu từ đường dẫn chuyển đổi ggplotly với một biểu đồ loess geom_smooth có thể tái lập, sử dụng level=0.95, rồi so sánh biểu đồ đó với đầu ra của ggplot. Công việc được xem là hoàn tất khi dải khoảng tin cậy bổ sung không còn được tạo ra và biểu đồ đã chuyển đổi khớp với biểu đồ nguồ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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100