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

3D vector fields don't plot correctly #105

Open
chillenb opened this issue Dec 18, 2023 · 3 comments
Open

3D vector fields don't plot correctly #105

chillenb opened this issue Dec 18, 2023 · 3 comments
Labels

Comments

@chillenb
Copy link

I am trying to run

using Grassmann, Makie; @basis S"∞+++"
streamplot(vectorfield(exp((π/4)*(v12+v∞3)),V(2,3,4),V(1,2,3)),-1.5..1.5,-1.5..1.5,-1.5..1.5,gridsize=(10,10))

Of course, I first get an error ERROR: No backend available!

but after loading CairoMakie, rerunning

streamplot(vectorfield(exp((π/4)*(v12+v∞3)),V(2,3,4),V(1,2,3)),-1.5..1.5,-1.5..1.5,-1.5..1.5,gridsize=(10,10))

produces the following image:
strange_vecfield3d

I am using Julia v1.9.4 (x64 linux) and the following packages are installed:

  [13f3f980] CairoMakie v0.11.3
  [e9467ef8] GLMakie v0.9.3
  [4df31cd9] Grassmann v0.8.6
  [ee78f7c6] Makie v0.20.2
  [9b87118b] PackageCompiler v2.1.16
  [91a5bcdd] Plots v1.39.0
@chillenb
Copy link
Author

The 2D vector field examples seem to work just fine

@chakravala
Copy link
Owner

Thanks for reporting, this is an issue with Makie.jl itself and not with Grassmann.jl specifically:

Observe that

f = vectorfield(exp((π/4)*(v12+v∞3)),V(2,3,4),V(1,2,3))

returns a function which can accept Point input

julia> f(Point(1,1,1))
3-element Point3{Float64} with indices SOneTo(3):
 -0.5
  0.49999999993486655
  0.9999999999348665

So the vectorfield method defined in Grassmann works the same as it always has for this example.

The issue seems to be with the streamplot function in Makie.jl ... perhaps you should open an issue there?

All the example does is feed f into the streamplot method from Makie, so the issue is with Makie.streamplot it seems.

@chillenb
Copy link
Author

Thanks for looking into this for me!

I see now that the problem is definitely a Makie regression. The arrows in 3D streamplot are much too large by default. The good news is that I was still able to run your example by setting the arrow size explicitly: streamplot(..., arrow_size=0.1)

Happy holidays!
Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants