Descending Axis Meshgrid Plotting
조회 수: 10 (최근 30일)
이전 댓글 표시
[EDIT: 20110512 16:59 - reformat - WDR]
Dear fellow MATLAB Users,
I am plotting data over a meshgrid, and would like to reverse the plotted "Y" axis from ascending to descending. For some reason, when changing my meshgrid parameters to allow for this, I am prompted with a 1x1 plotting window. Here is my code as it stands before making my alteration:
__________ CODE START __________
z=zeros(1,12);
xD=[1600;1666;1730;1780;1810;1800;1780;1770;1740;1720;1670;1610];
yD=[700;730;790;860;980;1030;1020;1100;1070;1030;970;930];
[x,y] = meshgrid(487:4:2074, 213:4:1106);
z_sum = 0*x;
h = surf(x,y,z_sum,'linestyle','none');
axis image
for i=1:numel(xD);
z=550 - 4.2*sqrt((x-xD(i)).^2+(y-yD(i)).^2);
z(z<0) = 0;
z_sum = z_sum + z;
set(h,'zdata',z_sum);
view([0 90])
drawnow;
pause(.01);
end
__________ CODE END __________
This will return my desired plot, with exception to a descending "Y" axis. This is how my code appears after alterating:
__________ NEW CODE START __________
z=zeros(1,12);
xD=[1600;1666;1730;1780;1810;1800;1780;1770;1740;1720;1670;1610]; yD=[700;730;790;860;980;1030;1020;1100;1070;1030;970;930];
[x,y] = meshgrid(487:4:2074, 1106:4:213);
z_sum = 0*x; h = surf(x,y,z_sum,'linestyle','none'); axis image
for i=1:numel(xD); z=550 - 4.2*sqrt((x-xD(i)).^2+(y-yD(i)).^2); z(z<0) = 0; z_sum = z_sum + z; set(h,'zdata',z_sum); view([0 90]) drawnow; pause(.01); end
__________ NEW CODE END __________
Notice how a 1x1 unit plot is created. I cannot understand why this is occurring, nor what to do to remedy it. Any help that could be lent to solve this issue would be greatly appreciated.
Thank you,
~ Chris
댓글 수: 1
Asawari
2013년 10월 18일
Hi.I am facing the same problem.I am applying mesh command and I want to arrange the axes in descending order instead of ascending.If you have got the answer can you please help me out also?
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!