Skip to content

Commit

Permalink
fix streamplot 3D default arrow size
Browse files Browse the repository at this point in the history
  • Loading branch information
chillenb committed Dec 30, 2023
1 parent 98d83c2 commit a57aae6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/basic_recipes/streamplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See the function `Makie.streamplot_impl` for implementation details.
maxsteps = 500,
color = norm,

arrow_size = 15,
arrow_size = nothing,
arrow_head = automatic,
density = 1.0,
quality = 16,
Expand Down Expand Up @@ -213,10 +213,18 @@ function plot!(p::StreamPlot)
rotations = map(x -> x[2], data)
end

if p.arrow_size[] == nothing
if N == 3
arrow_size = 0.2 * minimum(p.limits[].widths) / minimum(p.gridsize[])
else
arrow_size = 15
end
end

scatterfun(N)(
p,
lift(first, p, data);
markersize=p.arrow_size, rotations=rotations,
markersize=arrow_size, rotations=rotations,
color=lift(x -> x[4], p, data),
marker = lift((ah, q) -> arrow_head(N, ah, q), p, p.arrow_head, p.quality),
colormap_args...,
Expand Down

0 comments on commit a57aae6

Please sign in to comment.