lets-plot
lets-plot copied to clipboard
Enable adding custom point shapes
It would be helpful to have the ability to add custom point shapes (by providing an SVG of them, for example).
Similar request: LPK-112.
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: