-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better multiplots #72
Draft
Kucharssim
wants to merge
15
commits into
jasp-stats:master
Choose a base branch
from
Kucharssim:patchworkScatter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vandenman
reviewed
Nov 1, 2022
Kucharssim
force-pushed
the
patchworkScatter
branch
from
September 11, 2023 14:31
8222e09
to
25a4694
Compare
Closed
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I discussed with @vandenman, currently we have about a bazillion implementations of multi-plots that share similar structure, so let's add yet another implementation! Namely:
Displays the joint distribution of two variables with their marginal distributions along the axes in this layout:
This layout is implemented in
jaspBivariateWithMargins()
.Displays potentially more than two variables in one plot, with marginal distributions on the diagonal, something on the upper diagonal, and something/nothing in the lower diagonal.
This layout is implemented in
jaspMatrixPlot()
. The matrix plot also allows overwriting the default plots with custom plotting functions so that developers can for example display raincloud plots or traceplots on the diagonal or whatever.The idea is that these functions can be reused in all analyses using these common layouts, and themselves reuse a common functions for drawing the marginal (
jaspHistogram()
) and joint (a newjaspBivariate()
) distributions, so that we keep the implementation consistent between analyses but also with the elementary plots like standard histograms.While we are doing this it would be good to settle on a reasonable default behavior so that we really push for consistency, but there are some exceptions needed in specific analyses so the new functions are quite flexible. See the expandable "Examples" section below for examples (and attached code and jasp file for comparison: examples.zip).
The main advantage of using
patchwork
for stitching the plots together is that it ensures that axes in the subplots are spatially aligned, so we avoid misaligned axes like thisIt's also easier to "collect" legends from each subplot and display them outside of the plotting area.
There is still work to be done, here are some to-do's:
jaspHistogram()
, perhaps I need to fiddle with it a little bitBefore I continue, it would be nice to get some feedback:
jaspGraphs
? That way it would be easier to maintain the functionality if we need to fix or change something. The unit tests in individual modules then would not have to focus on how the plots look like, but more on whether a plot is drawn given a specific option selected, etc. What's your take @vandenman ?Examples
Descriptives
Basic plots: Correlation plots
Default
Manual bins
Density on diagonals
Rug marks on diagonals
Customisable plots: Scatter plots
Default
Grouped
Correlations
Scatter plots: default
Scatter plots: additional stuff
Pairwise plots
JAGS
Additional custom shennanigans
Created on 2022-10-20 with reprex v2.0.2