问题
Does anyone know how to plot a 3D surface with Julia's Pyplot with e.g the norm of the surface-gradient as the face color?
Similar to this topic for Python: Color matplotlib plot_surface command with surface gradient
回答1:
I saw this and I just HAD to make it work. It was almost supported out of the box with Plots.jl, using the PyPlot backend. I just had to swap out for a custom matplotlib shader to apply a different z-matrix.
You'll notice that I'm accessing numpy's gradient function (imported through PyCall), and I'm wrapping the gradient matrix (G) so that it doesn't get sliced into columns. All in all... much simpler than the python example!
Note: until I merge/tag, you'll have to checkout the dev branch of Plots: Pkg.checkout("Plots","dev")
来源:https://stackoverflow.com/questions/36925356/julia-pyplot-plot-3d-surface-with-as-face-colors-the-norm-of-surface-gradient