Spineplot wishlist
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 需要釐清
- 活躍度
- 冷清
- 技術堆疊
- r
研究方向
從 type_spineplot() 進入點開始,重現 issue 中的 tinyplot() 範例,並將其與 base R 的 spineplot() 和 mosaicplot() 進行比較。在變更實作之前,解決邊框處理、by 變數和灰色序列色彩方面尚未確定的設計問題;當要求的顯示效果和色彩行為與已達成共識的範例一致時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Disclaimer: I have collected a few issues that could be improved in spineplots, some of which were already discussed in #657. I'm happy to start addressing the issues but would appreciate some guidance/feedback first. This can easily wait until after the summer vacation!
Border color
In #657 spineplots received border = par("fg") as the border color rather than border = icol. Wouldn't the latter be more consistent, e.g., with boxplot? Also, I think that this means that the border color cannot be set as an argument to tinyplot(...) or type_spineplot(...).
My suggestion would be to export a border = NULL argument in type_spineplot(). Possibly additionally switch to border = icol internally when the user specifies border = "by"?
As an illustration we can use the following code. The first plot shows the current border = par("fg") and the latter shows what we would get with border = icol.
tinyplot(species ~ bill_dep | sex, facet = "by", data = penguins, legend = FALSE, theme = "clean2")
by variable
The current implementation of the by variable was always just a poor interim solution which was only marginally better than saying that by was not supported.
The natural strategy would be to simply add further vertical splits for the by variable (in addition to the x variable). The basic idea is straightforward and can be approximated by using interaction(x, by).
ucb = as.data.frame(UCBAdmissions)
tinyplot(Admit ~ interaction(Gender, Dept, sep = "\n"), data = ucb, weights = Freq)
However, the spacing (tol) should be improved and it would also be possible to get nicer axis labels. This could be similar to what mosaicplot() in base R does:
mosaicplot(aperm(UCBAdmissions, 3:1), dir = c("v", "v", "h"), off = c(6, 3, 0), col = gray.colors(2, rev = TRUE), main = "")
An open question is whether this display should be produced with Gender as the by variable (i.e., Admit ~ Dept | Gender) or with Dept (i.e., Admit ~ Gender | Dept). For categorical x variables like here, I would find Gender as the by variable a bit more intuitive. However, it wouldn't look good to use the same display for a numeric x variable. So I think we should go with Dept as the by variable here.
Note that the display is similar to but not quite the same as the corresponding faceted display below. The crucial difference is that in the faceted display every Dept gets the same size for the facet. In contrast in the by display you should be able to see the marginal distribution of Dept as well, e.g., that there are more observations in department A than in department B.
tinyplot(Admit ~ Gender, data = ucb, facet = 1 ~ Dept, weights = Freq)
Black-based gray sequential colors
In the single-group case the sequential palette constructed from black is actually set up via gray.colors() to match what base R does in spineplot().
However, in the multi-group case the same is not done. See the left group below which really uses full black as the base color which is probably a bit too "heavy". Switching to gray.colors() here would also work better.
tinyplot(Admit ~ Gender | Dept, data = ucb, facet = 1 ~ Dept, weights = Freq)
- 主要語言
- R
- 星號
- 430
- 分支
- 24
- 平均合併
- 14 小時 17 分鐘
- 30 天內合併 PR
- 8
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
grantmcdermott/tinyplot 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 63/100
grantmcdermott/tinyplot#759 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 67/100
grantmcdermott/tinyplot#664 · 4 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
grantmcdermott/tinyplot#663 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 62/100
grantmcdermott/tinyplot#659 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
grantmcdermott/tinyplot#612 · 3 則留言 ·
維護者通常 1 天內回覆
查看 grantmcdermott/tinyplot 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
bcgov/aqwarnings_shiny#128 ·
-
tech-debt
難度 2/5 1-3 小時 新手友好度 70/100
sagemathinc/sagebrush#3570 ·
維護者通常 1 天內回覆
-
bug upkeep
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
ropensci/lingtypology#94 ·