Give beeswarm plots fixed limits given input data #26
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.
Currently, whenever you call
autolimits!
on an axis with a beeswarm plot in it, you get a different result, because it takes the limits of the current scatter plot, but the algorithm finds a new result given those new limits.I think it makes more sense to pick fixed limits and then adjust axis size or marker size if that's not enough space. You don't get "more" space for the beeswarm anyway by expanding limits, as the extent depends only on screen space.
This PR simply uses the heuristic that having the same space available for each swarm looks good, so it sets data limits that way. If swarms extend out of an Axis, that probably means that they also overlap each other in the middle anyway. So you're unlikely to get a better image by deviating from the heuristic.