lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

Revise the scales for sizes of points

Open ASmirnov-HORIS opened this issue 1 year ago • 0 comments

scale_size() should scale the area of a point, not it's radius.

For example,

data = {
    'x': [1, 2, 3, 4],
    'y': [0, 0, 0, 0],
    'size': [0, 2, 4, 32]
}
ggplot(data, aes('x', 'y')) + geom_point(aes(size='size')) + scale_size(range=[1, 20])

gives

but I expect more smooth transition of a size:

This should result in a better perception of point sizes. And this is how it works in ggplot2.

The same should be done for the functions scale_size_area() and scale_size_identity().

The current way of scaling (size to radius) should be moved to the new function, scale_radius().

ASmirnov-HORIS avatar Mar 27 '24 13:03 ASmirnov-HORIS