-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Add :mesh3d series type for Plotly #2909
Add :mesh3d series type for Plotly #2909
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Adrian,
thanks for this contribution. That is a really good feature and a worthwhile addition to Plots.jl.
There are some things we need to adjust. Firstly, the API is not really in line with what Plots usually does and i, j, k
are hard to discover keywords. So I would suggest we add a new series keyword connections
(better names welcome) and pass a tuple of vectors like
mesh3d(x, y, z, connections = (i, j, k))
In the future we then could also support vectors of tuples and matrices.
Secondly it would be good to have an example in the examples file, so this gets added to the tests and shows up in the documentation and there should also be an explanation of what the values of i
, j
and k
actually refer to.
Hi Simon, Regarding the first point that sounds like a much cleaner interface. Am I right that adding |
You are right. That is the way to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the last round of changes and its mainly cosmetics
Co-authored-by: Simon Christ <[email protected]>
Co-authored-by: Simon Christ <[email protected]>
Co-authored-by: Simon Christ <[email protected]>
Okay great, then everything should be fine now. |
Thanks! |
Does this support setting the colours of the triangle? Trying to plot a function a sphere: have the sphere working but now need the colours |
No I don't think this is supported. As a hacky workaround you could plot the triangles individually since you can specify the color of the whole mesh like this |
That's too bad... I'm guessing the Plotly backend supports it? |
This pull-request adds the possibility to plot arbitrary 3d meshes using the mesh3d plot type in Plotly. It can be seen as partial fix/implementation for #392. For backends other than Plotly there is a fallback recipe provided that however does not support specifying the triangles of the mesh.
Example:
Output: