Skip to content
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

Use TidierPlots for some of the graphics #55

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

dmbates
Copy link
Contributor

@dmbates dmbates commented Apr 24, 2024

It seems that AlgebraOfGraphics.jl is not being actively developed and I decided to take a look at TidierPlots.jl as a possible replacement. At present some of the facilities for comparative plots still need refinement. Faceting is broken after the switch to Makie as a back-end and vector color/colour arguments in aes are often interpreted as if they were color specs instead of categorical vectors that determine the color of the geom.

This branch provides a few plots with TidierPlots.jl for evaluation of whether this is a good path to follow.

@dmbates dmbates marked this pull request as draft April 24, 2024 19:35
@dmbates dmbates requested review from palday and kliegl April 24, 2024 19:35
@kliegl kliegl marked this pull request as ready for review May 20, 2024 20:07
@kliegl kliegl marked this pull request as draft May 20, 2024 20:08
Copy link
Member

@palday palday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking good.

AoG is getting some love again (https://github.com/MakieOrg/AlgebraOfGraphics.jl/releases/tag/v0.7.0) but switching over to a plotting package that's closer to everybody's favorite R package is probably better for reaching a broader audience. (=I'm still onboard with swapping to TidierPlots for books and teaching.)

Comment on lines +1137 to +1141
# draw(
# data(gausshermitenorm(9)) *
# mapping(:abscissae => "Positions", :weights);
# figure=(; size=(600,450)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(gausshermitenorm(9)) *
# mapping(:abscissae => "Positions", :weights);
# figure=(; size=(600,450)),
# )

Comment on lines +1154 to +1160
# draw(
# data(gausshermitenorm(9)) * mapping(
# :abscissae => "Positions",
# :weights => log2 => "log₂(weight)",
# );
# figure=(; size=(600,450)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(gausshermitenorm(9)) * mapping(
# :abscissae => "Positions",
# :weights => log2 => "log₂(weight)",
# );
# figure=(; size=(600,450)),
# )

Comment on lines +661 to +669
# draw(
# data(@subset(dsm01pars, :type == "σ")) *
# mapping(
# :value => "Bootstrap samples of σ";
# color=(:group => "Group"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(@subset(dsm01pars, :type == "σ")) *
# mapping(
# :value => "Bootstrap samples of σ";
# color=(:group => "Group"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )

Comment on lines +170 to +178
# #| warning: false
# let wlen = 1:21
# draw(
# data((; wrdlen=wlen, count=counts(byitem.wrdlen, wlen))) *
# mapping(:wrdlen => "Length of word", :count) *
# visual(BarPlot);
# figure=(; size=(600, 450))
# )
# end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# #| warning: false
# let wlen = 1:21
# draw(
# data((; wrdlen=wlen, count=counts(byitem.wrdlen, wlen))) *
# mapping(:wrdlen => "Length of word", :count) *
# visual(BarPlot);
# figure=(; size=(600, 450))
# )
# end

Comment on lines +355 to +360
# draw(
# data(pruned) *
# mapping(:rt => "Response time (ms.) for correct responses") *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(pruned) *
# mapping(:rt => "Response time (ms.) for correct responses") *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )

Comment on lines +374 to +384
# draw(
# data(pruned) *
# mapping(
# :rt =>
# (
# x -> 1000 / x
# ) => "Response speed (s⁻¹) for correct responses",
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(pruned) *
# mapping(
# :rt =>
# (
# x -> 1000 / x
# ) => "Response speed (s⁻¹) for correct responses",
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )

Comment on lines +609 to +617
# draw(
# data(@subset(bxm03pars, :type == "ρ")) *
# mapping(
# :value => "Bootstrap replicates of correlation estimates";
# color=(:names => "Variables"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 400)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(@subset(bxm03pars, :type == "ρ")) *
# mapping(
# :value => "Bootstrap replicates of correlation estimates";
# color=(:names => "Variables"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 400)),
# )

Comment on lines +282 to +290
# draw(
# data(@subset(pnm01pars, :type == "σ")) *
# mapping(
# :value => "Bootstrap samples of σ";
# color=(:group => "Group"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(@subset(pnm01pars, :type == "σ")) *
# mapping(
# :value => "Bootstrap samples of σ";
# color=(:group => "Group"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )

Comment on lines +456 to +464
# draw(
# data(@subset(psm01pars, :type == "σ")) *
# mapping(
# :value => "Bootstrap samples of σ";
# color=(:group => "Group"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# draw(
# data(@subset(psm01pars, :type == "σ")) *
# mapping(
# :value => "Bootstrap samples of σ";
# color=(:group => "Group"),
# ) *
# AlgebraOfGraphics.density();
# figure=(; size=(600, 340)),
# )

@dmbates
Copy link
Contributor Author

dmbates commented Jul 19, 2024

It appears that an earlier issue, TidierOrg/TidierPlots.jl#102, has resurfaced. I think we should delay merging this PR until that issue is resolved. It is probably also related to the mismatch of symbol color and line color is some of the plots in largescaleobserved.qmd.

@ajinkya-k
Copy link
Contributor

Can this be merged now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants