plotly / plotly/plotly.R

Incorrect behavior of dynamicTicks vs autorange in facet mode

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

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

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

説明

Hello!
I want to use dynamic ticks for plots in application. With that, need not to limit the plot by x axis (i want some spaces on the borders). I do that by "autorange = FALSE" in layot. For single plot it's work fine, but for facet_wrap or facet_grid plots it works fine only for the first plot (left). I tried to use xlim, coord_cartesian with xlim, scale_x_continuous. Nothing helps.
Plots are created using ggplot2 (ver. 3.1.0) and then rendered using ggplotly (plotly ver. 4.8.0).

My code:

library(data.table)
library(plotly)
library(ggplot2)

a1 <- c(1:50)
b1 <- rnorm(50, 30, 10)
c1 <- c(rep(c("abc","def"),25))
dt <- as.data.table(list("valueX" = a1, "valueY" = b1, "facetCol" = c1))
dt$facetCol <- as.factor(dt$facetCol)

pplot <- ggplot() + geom_line(data = dt, aes(x = valueX, y = valueY)) +
                    facet_wrap(~dt$facetCol, ncol = 2)
ggplotly(dynamicTicks = TRUE, pplot) %>% layout(xaxis = list(autorange = FALSE))

How i see it:
1

What i want:
2

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

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

はじめの一歩

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

調査の方向性

まず、提供された R の再現例を ggplot2 3.1.0 と plotly 4.8.0 で実行し、単一プロットと facet_wrap の出力を比較します。ggplotly が facet の軸と設定 layout(xaxis = list(autorange = FALSE)) をどのように変換するかを調べます。完了の条件は、すべての facet で autorange が一貫して無効になり、動的な目盛りと要求された境界間隔がすべての facet で機能することです。

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

評価

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

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

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