Colour recycling without `by` variable

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
r

調査の方向性

まず、issue にある 3 つのプロット例を再現し、by 変数が指定されていない場合の tinyplot と base R を比較します。tinyplot における色のリサイクル動作を追跡し、issues #410 と #476 の関連する作業を確認します。意図した by なしの色のルールが決定・実装され、回帰例またはテストでカバーされれば完了です。

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

説明

In #410 we had improved the colour recycling when groups are defined using a by variable. This still seems to be fine to me.

When there is no by variable, i.e., only y and/or x, then only a single color is used because there is only a single by group. This makes sense in many situations but sometimes you want to color every point/line/bar with a different color (as in #476). This is possible in base R's plot() but in tinyplot() it requires setting up a suitable by variable.

As a simple example, consider plotting points 1:5 in colors 1:5:

    plot(1:5, col = 1:5, pch = 19, cex = 5)
tinyplot(1:5, col = 1:5, pch = 19, cex = 5)
tinyplot(1:5, col = 1:5, pch = 19, cex = 5, by = factor(1:5), legend = FALSE)
Image
  • In base R just setting col = 1:5 is sufficient for getting five points in five different colors.
  • In tinyplot this is identified as a scenaria with only a single by group and hence only one color is used.
  • This can only be changed easily with a categorical by variable.

Maybe in the case without by variable we need to reconsider the color recycling rules?

主要言語
R
スター
430
フォーク
24
平均マージ
14時間 17分
マージ済み PR(30日)
8

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

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

grantmcdermott/tinyplot のほかの issue

grantmcdermott/tinyplot の issue をすべて見る

似ている issue

R の issue をもっと見る

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

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