Scatter plot vector of (Static)vectors with Plots

Is there a more direct way to plot a vector of vectors as a scatter plot with plots?

julia> using Plots, StaticArrays

julia> points = rand(SVector{2,Float64},10);

julia> scatter([x[1] for x in points],[ x[2] for x in points]) # a cleaner way to do this?

image

One option:

scatter(eachrow(hcat(points...))...)
1 Like

Maybe

scatter(first.(x)..., last.(x)...)
2 Likes

No need to splat it seems: scatter(first.(points),last.(points))

4 Likes

Of course, those are vectors already! Perils of posting from mobile…

2 Likes

Shorter: scatter(Tuple.(points))

4 Likes