surf and color bar does not show correct color gradient.
이전 댓글 표시
The 'surf' command does not show the correct color gradient, e.g. for the 10x10 matrix below
0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201
0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149
0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057
0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010
0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057 0.0057
0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149 0.0149
0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201 0.0201
it shows the figure like this

on the left and right it has same nodal values so it should show the same color gradient. Please help how to fix it.
Many Thanks in Advance.
Abdullah.
채택된 답변
추가 답변 (1개)
Chad Greene
2015년 5월 19일
Follow your plotting command with
shading interp
댓글 수: 2
Chad Greene
2015년 5월 19일
and if you want to keep the lines of the grid,
s = surf(x);
shading interp
s.EdgeColor = 'k';
Abdullah Waseem
2015년 5월 20일
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!