Maybe this question is a duplicate because I can imagine that many people face this problem. Forgive me if so.
I want to plot a sphere in Matplotlib 3D. For that, I have a bunch of xyz coordinates. When I plot it with plot_trisurf
, I get this:
So I wanted to try plot_surface
, but then I get the error ValueError: Argument Z must be 2-dimensional.
This post explains why the input for plot_surface
is 2D.
My question ist: How can I convert my regular xyz coordinates into the format plot_surface
needs?
Edit:
Okay, I understood that 3-tuples can be differently interpreted. Is there a way then to use plot_trisurf
with some kind of polar coordinates, so that it doesn't interpolate "through the xy plane" but from the coordinate origin, spherically?