当我想旋转使用 contour3
绘制的线条时,线条的图形句柄似乎已被删除。我怎样才能得到轮廓线的句柄?或者是否可以使用轮廓矩阵 C
旋转线条?
>> x = -2:0.25:2; x = -2:0.25:2;
>> [X,Y] = meshgrid(x);
>> Z = X.*exp(-X.^2-Y.^2);
>> C=contour3(X,Y,Z,10,'m');
>> hd=gca;
>> rotate(hd,[0 1 0],90,[0 0 0]);
最佳答案
您需要从 contour3
获得第二个输出,这是 Contour
graphics object 的句柄:
[C, h] = contour3(...);
不幸的是,这不会帮助您解决旋转问题。来自 rotate
的文档:
rotate(h,direction,alpha)
rotates the graphics objecth
byalpha
degrees. Specifyh
as a surface, patch, line, text, or image object. ...
关于matlab - 如何在 MATLAB 中获取 contour3 绘制的曲线句柄?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44680766/