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

Points plotted behind a surface appear as if in front #446

Open
giancarloantonucci opened this issue Jan 26, 2022 · 2 comments
Open

Points plotted behind a surface appear as if in front #446

giancarloantonucci opened this issue Jan 26, 2022 · 2 comments

Comments

@giancarloantonucci
Copy link

As per title. For instance, one of the two points produced with this MWE should appear behind the surface, but it doesn't:

using Plots; gr()
Θ₁ = -π:0.01:π
Θ₂ = -π:0.01:π
X_torus = [(1 + cos(Θ₂ᵢ)) * cos(Θ₁ᵢ) for Θ₁ᵢ in Θ₁, Θ₂ᵢ in Θ₂]
Y_torus = [(1 + cos(Θ₂ᵢ)) * sin(Θ₁ᵢ) for Θ₁ᵢ in Θ₁, Θ₂ᵢ in Θ₂]
Z_torus = [sin(Θ₂ᵢ) for Θ₁ᵢ in Θ₁, Θ₂ᵢ in Θ₂]
surface(X_torus, Y_torus, Z_torus, colorbar = :none, legend = false, xlims = [-2, 2], ylims = [-2, 2], zlims = [-2, 2]);
scatter!([-2,2], [0, 0], [0, 0], ms=5, color=:black)

plot

Using plotlyjs() this issue doesn't happen, so it seems to be a gr() problem. See this discourse page for more details.

@jheinen
Copy link
Owner

jheinen commented Jan 27, 2022

Unfortunately, this functionality (mix 2D scatter and 3D surfaces) is currently not provided for in GR and cannot be implemented without major reimplementations.

@giancarloantonucci
Copy link
Author

My original intention was to mix a 2D line (rather than a 2D scatter plot) with a 3D surface. I guess even this functionality, being so closely related to the one above, isn't (and won't) be provided as well?

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

No branches or pull requests

2 participants