How to change colour in waterfall plot?
    10 ビュー (過去 30 日間)
  
       古いコメントを表示
    
Hi,
I did waterfall plots and I need to do a patch to get nicer output. I want to control the colour output: black, grey
and green for the plots in the graph below.
All suggestion are welcome
   t=10:20:60;
   x=0:1:200;
   Y=bsxfun(@(x,t) normpdf(x,t,20),x,t.'); 
   figure
   colordef white
   set(gcf, 'color', [1 1 1])
   h = waterfall(x,t,Y,zeros(size(Y)));
   set(h, 'FaceColor', 'flat');
   set(h, 'EdgeColor', 'k');
   set(h, 'FaceVertexCData', rand(3,3))

0 件のコメント
採用された回答
  KSSV
      
      
 2017 年 7 月 24 日
           set(h, 'FaceVertexCData', rand(3,3))
This is the line which gives color to your surfaces. As you have three surfaces there, it should be a 3x3 matrix. Note that RGB color code has 1X3 vector for each color. So, that line selected three random colors. Say you want to fill Red color for each surface. YOu need to follow like this:
color = repmat([1 0 0],3,1)
set(h, 'FaceVertexCData', color)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Polygons についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

