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.
Fixes #635
Before, Makie could in some cases pick limits that were too tight for a given categorical axis, for example if categories were added without data:
Now, invisible entries are added that keep the limits at least at first-0.5 to last+0.5, which makes sense given that each category always gets a column of width 1 centered around its position. The example above then becomes:
I had actually thought about doing this for a while, not necessarily because of the missing categories edge case, but because widthless plots like scatters look cramped with categorical data, as can be seen above. That normal case now looks like this, which is much more balanced:
Although this PR changes a lot of reference images slightly, I don't consider it breaking, because this is both a bug fix and an aesthetic improvement, where I don't expect anybody to rely on the exact auto-margin they got previously with categorical data.