This solution works nicely, but as with the poly
solution, I’m wondering if there’s a way to change the space-units from data to pixel. When you zoom in on a regular scatter-marker the size of the marker doesn’t change, which is great. I would have liked to be able to create a custom marker (from a polygon) that behaves similarly.
For more context
I’m trying to create and use a new rotated drop-shaped marker, which works really well following the docs https://makie.juliaplots.org/stable/documentation/recipes/index.html#multiple_argument_conversion_with_convert_arguments:
using CoordinateTransformations, Rotations
struct DirectedDrop{T<:AbstractVector}
c::T
θ::Float64
end
function Makie.convert_arguments(::PointBased, x::DirectedDrop)
f = Translation(x.c) ∘ LinearMap(Angle2d(x.θ))
n = 64
([f(Point2f(cos(t), sin(t)*sin(t/2)^2)) for t in range(0, 2π, n + 1)[1:end-1]], )
end
c = Point2f(2,3)
dd = Node(DirectedDrop(c, 0.0))
poly(dd, axis = (aspect = DataAspect(), ))
My question is, what is the best way to plug in the whole interplay between MarkerSpace
versus DataSpace
? And as a side-question, in the decomposition of my DirectedDrop
, what is the correct way to specify the number of vertices I use to create the drop (right now, I just have it hard-coded to 64)?