Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix streamplot 3D default arrow size #3525

Merged
merged 4 commits into from
Jan 8, 2024
Merged

Conversation

chillenb
Copy link
Contributor

@chillenb chillenb commented Dec 30, 2023

Description

Fixes #3504

The default arrow size in 3D streamplot is set to
0.2 * minimum(limits.width) / minimum(gridsize)
per @chakravala's comment in #3504.

The default arrow size in 2D streamplot remains 15 px.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@chakravala
Copy link

Fixes chakravala/Grassmann.jl#105

@@ -28,7 +28,7 @@ See the function `Makie.streamplot_impl` for implementation details.
maxsteps = 500,
color = norm,

arrow_size = 15,
arrow_size = nothing,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be automatic since we generally use that instead of nothing when things get derived later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've changed nothing to automatic!

Comment on lines 216 to 222
if p.arrow_size[] === automatic
if N == 3
arrow_size = 0.2 * minimum(p.limits[].widths) / minimum(p.gridsize[])
else
arrow_size = 15
end
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing an else branch which is why tests are failing. Might also be good to reorganize this so that p.arrow_size can change from automatic to some value. I.e. use arrow_size = map(p.arrow_size, p.limits, p.gridsize) do ....

@chillenb
Copy link
Contributor Author

chillenb commented Jan 8, 2024

@ffreyer thanks for cleaning this up. Much appreciated.

@SimonDanisch SimonDanisch merged commit 5ef0426 into MakieOrg:master Jan 8, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Streamplot 3D seems to be broken
4 participants