Descending Axis Meshgrid Plotting
3 次查看(过去 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!