【发布时间】:2019-06-19 15:20:48
【问题描述】:
我想在 MATLAB 图中的轴外的每个数据点处创建一条带有圆形标记的线,类似于什么
line([x1 x2],[y1 y2],'Color','k','Marker','o')
会产生。
要将线对象放置在轴之外,我只是尝试使用annotation:
annotation('line',phi1([x1 x2]),phi2([y1 y2]),'Color','k','Marker','o')
其中phi1 和phi2 是适当的坐标变换,以适应当前图形的轴内的坐标x 和y。
我希望这可以工作,因为线对象具有marker 属性。但是,使用annotation,我收到以下错误消息:
Error using matlab.graphics.shape.Line/set
There is no Marker property on the Line class.
Error in matlab.graphics.chart.internal.ctorHelper (line 8)
set(obj, pvpairs{:});
Error in matlab.graphics.shape.Line
Error in annotation (line 128)
h = matlab.graphics.shape.Line(aargs{:});
同样,当使用annotation 函数绘制矩形时,不能设置Curvature 属性。似乎annotation 不支持这些类型的属性,即使它像line 或rectangle 函数那样创建一个直线或矩形对象。我尝试摆弄注释句柄和子项,但没有成功。
有什么解决方法的想法吗?
【问题讨论】:
标签: matlab plot properties annotations matlab-figure