plotly / plotly/plotly.R

Adding text shrinks bar chart area

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

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

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

説明

Adding text shrinks the bar chart area. Below we render a bar chart where the bars are on the x-axis. The add_text() call actually vertically shrinks the area of the plot, such that the distance from the bottom bar to the x-axis "0" is increased. If you run this output without the add_text() call, you'll see that the vertical width of the bar charts increases.

Adding text should not have an effect on the bar chart.

# Shrunken plot area
require(plotly)
#> Loading required package: plotly
#> Loading required package: ggplot2
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout

cats = c(letters, paste0(letters,'2'), paste0(letters,'3'), paste0(letters,'4') )

data = data.frame(
  y_axis_cat = rep(cats,8),
  x_axis_num = rep(5,length(cats)*8),
  cat = rep(paste0('Cat ',1:8), length(cats))
)

p = plotly::plot_ly(data) %>%
  plotly::add_bars(
    x = ~x_axis_num,
    y = ~y_axis_cat,
    color=~cat
  ) %>%
  plotly::add_text(
    x = 40,
    y = ~y_axis_cat,
    text = '40'
  ) 

Created on 2023-04-10 with reprex v2.0.2

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

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

はじめの一歩

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

調査の方向性

提供された R reprex を plotly::plot_ly()、add_bars()、add_text() とともに実行し、add_text() なしのバージョンと比較します。棒グラフの垂直方向の領域が縮小する原因となっているプロットレイアウトの挙動を追跡します。完了条件は、テキストを追加しても下側の棒と x 軸のゼロとの距離が増えなくなることです。

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

評価

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

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

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