Spineplot wishlist
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- Calme
- Stack technique
- r
- Domaine
- data-visualization
Piste de recherche
Commencez par le point d’entrée type_spineplot() et reproduisez les exemples de tinyplot() dans l’issue, en les comparant à spineplot() et mosaicplot() de base R. Tranchez les questions de conception encore ouvertes concernant la gestion des bordures, la variable by et les couleurs séquentielles grises avant de modifier l’implémentation ; le travail est terminé lorsque les affichages demandés et le comportement des couleurs sont cohérents avec les exemples convenus.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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)
- Langage dominant
- R
- Étoiles
- 430
- Forks
- 24
- Merge moyen
- 14 h 17 min
- PR mergées (30 j)
- 8
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de grantmcdermott/tinyplot
-
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
grantmcdermott/tinyplot#759 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 67/100
grantmcdermott/tinyplot#664 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
grantmcdermott/tinyplot#663 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
grantmcdermott/tinyplot#659 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
grantmcdermott/tinyplot#612 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de grantmcdermott/tinyplot
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
bcgov/aqwarnings_shiny#128 ·
-
tech-debt
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
sagemathinc/sagebrush#3570 ·
Les mainteneurs répondent en général sous 1 jour
-
bug upkeep
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
phoible.feature() failsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
ropensci/lingtypology#94 ·