fill3 not working

9 次查看(过去 30 天)
I am trying to plot a simple white (or any solid color for that matter) rectangle. I've tried
px=[.5 .5 -5 -.5];
py=[-.3 .3 -.3 .3];
pz=[.3 .3 .3 .3];
X = [px; px];
Y = [py; py];
Z = [-pz; pz];
C = [1 1 1 1; 1 1 1 1];
figure
fill3(X,Y,Z,C);
But only a black box shows up. I've tried different values in the C matrix such as all .5's but still just shows the same black box. What am I doing wrong??? I appreciate any help anyone can give,
Thanks,
Thomas

采纳的回答

Walter Roberson
Walter Roberson 2016-5-25
Perhaps
fill3(X',Y',Z',1);
  2 个评论
Thomas Kirven
Thomas Kirven 2016-5-25
Thank you Walter! That worked, well sort of, it plotted two 2-D parallel rectangular planes, but it did not fill the space in between them, which I feel like it should do since it is called fill3 for 3-D polygons, where I have specified the 8 vertices. Do you know how to do this? I realize I could plot four more planar rectangles to make it appear to be a solid shape, but that seems like a ridiculous amount of work.
Thanks!
Walter Roberson
Walter Roberson 2016-5-26
fill3() does not fill between planes.
"If X, Y, and Z are matrices of the same size, fill3 forms a vertex from the corresponding elements of X, Y, and Z (all from the same matrix location), and creates one polygon from the data in each column."
Each of those polygons is filled -- independently of the others.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by