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

Scatterjitter #2872

Closed
wants to merge 4 commits into from
Closed

Scatterjitter #2872

wants to merge 4 commits into from

Conversation

behinger
Copy link
Contributor

Description

Fixes MakieOrg/AlgebraOfGraphics.jl#253

Adds weighted-jitter along the density of the distribution

Type of change

image

Delete options that do not apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@ffreyer
Copy link
Collaborator

ffreyer commented Apr 20, 2023

I think it would be better to have this as function you can apply to your data rather than a new plot type. E.g. scatter(jitter(xs), ys). That could then be reused with lines and other plotting primitives without the need for extra recipes.

@behinger
Copy link
Contributor Author

could such a function work with AoG?

PS: I made something related with Dodge, e.g. Dodge(Scatter,...) - but the other way round ;)
MakieOrg/AlgebraOfGraphics.jl#393 (comment)

@behinger
Copy link
Contributor Author

further, jitter would need access to both x & y, x to jitter, y to calculate the kde

@ffreyer
Copy link
Collaborator

ffreyer commented Apr 20, 2023

jitter(xs, ys) and/or jitter(ps) would be fine too

@behinger
Copy link
Contributor Author

It is still unclear to me how this would work with AoG.jl

@ffreyer
Copy link
Collaborator

ffreyer commented Jul 6, 2023

Sorry this kind of slipped my mind. I don't know how this would integrate with AoG. In Makie this would just be something you'd apply to your input before passing it to a plot function. In that sense it should be pretty similar to smoothing with Loess, which AoG seems to have an implementation for.

@behinger
Copy link
Contributor Author

behinger commented Jul 6, 2023

ok- then I would have to rewrite it though, to follow the AoG syntax. This is unlikely to happen in the next months, pretty swamped.

Here is an example:
https://github.com/MakieOrg/AlgebraOfGraphics.jl/blob/master/src/transformations/smooth.jl

I could also move the whole recipe to AoG

@asinghvi17
Copy link
Member

This is implemented in https://github.com/asinghvi17/SwarmMakie.jl as an extra algorithm for beeswarm plots :)

@behinger
Copy link
Contributor Author

very nice! beautiful :-)

@behinger behinger closed this Apr 29, 2024
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.

Jitter (feature request)
3 participants