plotly / plotly/plotly.R

[Bug] Geom_smooth graphical error when converting from ggplot to plotly using ggplotly

オープン
#1,472 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
R
スター
2.7k
フォーク
641
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

I have a graphical issue which shows up when converting a ggplot2 plot with geom_smooth to a plotly plot:
bugged

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:
ggplotly_correct_but_lower_confinterval

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:
ggplot_correct

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リポジトリのファイルもテストも指定されておらず、報告者はデータや軸を提供できません。level=0.95 を使用した再現可能な geom_smooth loess プロットで ggplotly の変換パスから開始し、ggplot の出力と比較してください。追加の信頼区間リボンが生成されなくなり、変換後のプロットがソースプロットと一致すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
r
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。