How exactly is the first vertex of a patch in surf determined?

2 次查看(过去 30 天)
In the documentation for the surf command it is stated that for faceColor = 'flat', "The color value at the first vertex of each face (in the positive x and y directions) determines the color for the entire face."
Paired with the accomanying drawing, I completely understand how this work for a rectangular grid. However, I would like to know what exactly is the 'first vertex' in case of a non-rectangular grid. I'm trying to make a polar plot with surf, and this is vital information.
PS, I tried to find out through the source of surf, but it seems like the magic happens in a .p file.
Thank you
  4 个评论
Steven Lord
Steven Lord 2020-9-23
As far as I'm aware it's not possible to create a surf plot on a polaraxes.
>> ax = polaraxes;
>> [x, y, z] = peaks;
>> surf(ax, x, y, z)
Error using matlab.graphics.chart.primitive.Surface
Surface cannot be a child of PolarAxes.
Error in surf (line 145)
hh = matlab.graphics.chart.primitive.Surface(allargs{:});
Trying to create a surf plot on an axes containing an older style polar plot probably won't do what you expect or want.
>> th = 0:0.1:2*pi;
>> r = 1:length(th);
>> h = polar(th, r);
>> ax = ancestor(h, 'axes');
>> hold on
>> surf(ax, x, y, z)
So can you explain a bit about how you are "trying to make a polar plot with surf"?
Tim M.J. Nijssen
Tim M.J. Nijssen 2020-9-23
please refer to my comment above, I created a polar representation inside a cartesian axes

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by