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

Enable adding custom point shapes

Open CommanderTvis opened this issue 3 years ago • 2 comments

It would be helpful to have the ability to add custom point shapes (by providing an SVG of them, for example).

CommanderTvis avatar Aug 15 '22 21:08 CommanderTvis

Similar request: LPK-112.

alshan avatar Aug 16 '22 17:08 alshan

We could start with a simpler variant where the shape of a point is specified by a Shapely object, for example:

r = 2/sqrt(3)
hexagon = Polygon([
    (r, 0), (r/2, 1), (-r/2, 1),
    (-r, 0), (-r/2, -1), (r/2, -1)
])

df = pd.DataFrame({'x': [0], 'y': [0], 's': [hexagon]})

ggplot(df, aes('x', 'y')) + \
    geom_point(aes(shape='s'), size=50) + \
    scale_shape_identity() + coord_fixed()

Output now:

Expected:

ASmirnov-HORIS avatar Apr 12 '24 10:04 ASmirnov-HORIS