matlab - 如何在 MATLAB 中获取 contour3 绘制的曲线句柄?

标签 matlab rotation contour handle

当我想旋转使用 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]);

输入最后一个命令后,线条没有移动。 (我使用的是 MATLAB 2016a。) enter image description here

最佳答案

您需要从 contour3 获得第二个输出,这是 Contour graphics object 的句柄:

[C, h] = contour3(...);

不幸的是,这不会帮助您解决旋转问题。来自 rotate 的文档:

rotate(h,direction,alpha) rotates the graphics object h by alpha degrees. Specify h as a surface, patch, line, text, or image object. ...

请注意,rotate 不适用于 axesContour 对象。相反,您需要使用 view 更改相机 View .

关于matlab - 如何在 MATLAB 中获取 contour3 绘制的曲线句柄?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44680766/

相关文章:

Carrierwave 中的条件版本

javascript - 尝试使用 jquery 使图像旋转

php - CSS 旋转的行为与 PHP 不同

python - OpenCV cv2.rectangle 输出二值图像

R:levelplot(轮廓中缺少一些值)

java - 从 JAVA 启动 MATLAB 代码时出现问题

matlab - 在 Matlab 中如何交换现有绘图的水平轴和垂直轴

c - matlab,我如何从多个文件夹中读取

python - 在使用 OpenCv 进行图像处理期间保留字符顺序

android - 搭建matlab eclipse界面