On Monday, January 9, 2012, Ethan Gutmann <email@example.com> wrote:
> Along these lines, it looks to me like plot_surface is not shading when I would expect it to (maybe I just have the wrong expectations?)
> I would expect the following to create a surface with colors from the colormap but shading from a lightsource.
> surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,shade=True)
> However, axes3d.py requires facecolors to be set in order to generate facecolors to shade...
> line 1378-1380 mpl v1.1.0
> # Shade the data
> if shade and cmap is not None and fcolors is not None:
> fcolors = self._shade_colors_lightsource(Z, cmap, lightsource)
> should the if statement be:
> if shade and cmap is not None and fcolors is None:
> I'm not sure if this will screw anything else up, but it makes a lot more sense to me as an API. Maybe there are other reasons to require facecolors to be set?
No, you are right. This is roughly the requested feature I was talking about. There are multiple features in plot_surface() that are entwined and I would like to figure out how to separate them and allow users to pick and choose.
Features I have identified:
Coloring edgelines (complicated to determine what color)
Coloring based on colormap
Coloring based on user-spec facecolors
Shading the colors (may or may not include edge lines)
Interpolating facecolors (for edgelines, IIRC)
These are inter-dependent and need to be made orthogonal.
Note, all of this is from memory, details might differ.