plotly / plotly/plotly.R

ggplotly geom_line vertical orientation is not working

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

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

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

説明

ggplot2's geom_line allows setting the y-axis as the independent variable, by plotting in the order of how x is arranged:

library(tidyverse)
library(plotly)

c2 = c(1,2,3,4)
c1 = c(3,2,1,4)

dataset = data.frame(x=c1,y=c2)

p = ggplot(dataset %>%
         arrange(y), aes(x=x, y=y))+ 
  geom_point()+
  geom_line(orientation="y")+
  labs(
    y = "Depth", x = "Maximum concentration", 
  )+
  scale_y_reverse()
p

which results in:
229020097-603fbf58-394f-47cf-84cc-6a2865296070

however, this does not carry over when the plot is converted to plotly:

g = ggplotly(p)
g

229020153-cdecf359-74fc-4339-bc38-c1fc612f19d2

I noted that the plotly documentation does mention orientation as well.
https://plotly.com/ggplot2/line-charts/#vertical-plot-orientation

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

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

はじめの一歩

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

調査の方向性

提供されている R の例を、ggplot2 の geom_line(orientation="y") と ggplotly(p) による変換を使って開始します。ggplot2 の結果と変換後のプロットを比較し、Plotly の垂直プロット方向に関するドキュメントを確認します。変換後のプロットが要求された垂直方向を維持すれば完了です。

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

評価

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

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

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