Why do I get the diagonal lines in my mesh plot?

My code:
N= 18; % Number of cells in x- and y-direction
x=linspace(0,1,N+1); y=x;
grid_value = ones(N+1,N+1);
mesh(x,y,grid_value) view([0 0 1])
If N is larger than 17 the plot will look like: http://i40.tinypic.com/2k3kur.jpg
But if N is smaller than 17 or smaller the plot will look like: http://i39.tinypic.com/ac8xi.jpg
Where do the diagonal lines come from? And how can I remove them?
UPDATE: if I save the file as .jpg the diagonal lines disappear.

댓글 수: 1

I seem to recall hearing of this as a bug. Which MATLAB version are you using, and which operating system?
Experiment with changing the figure renderer, such as
set(gcf, 'Renderer', 'painters')
Also experiment with the combination
set(gcf, 'Renderer', 'opengl')
opengl software

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

제품

질문:

2013년 4월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by