Size revamp3: ContinuousSizeScale #1386
Merged
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.
NEWS.md
This PR
Scale.size_radius
. This should become the defaultScale.size_continuous
in Gadfly 2.0 (Scale.size_radius
can also be kept as an alias)Scale.size_area
Design
There are three possible types of continuous sizes:
size=[s]
, wheres
is in x,y unitssize=[xmm]
i.e. absolute size (these are deferred toScale.size_identity
)-∞ < s < ∞
are mapped to absolute sizesScale.size_radius
andScale.size_area
have adefault_continuous_sizes(p)
function where0≤p≤1
. This maps proportions to absolute sizes (the default sizes are 0mm-2mm).If
maxvalue
is specified, the continuous sizes are converted to a proportion (betweenminvalue
andmaxvalue
), and then mapped to absolute sizes using the functionf(p)
.Examples
Note plot
p3
andp4
useScale.size_radius
andScale.size_area
respectively.Wrt the
size
aesthetic, the only outstanding issue is to get the axis scales to take into account the absolute sizes when calculating the axis limits e.g., in plotp2
above. This will be done in a future PR (see #1385)