如何摆脱matlab回归图中的蓝线?
How to get rid of blue line in regression plot in matlab?
我有一个带有蓝色 (lsline
) 的回归图,我想将其消除,但我不知道如何消除。
plotregression(y.testTargets, y.outputs)
如果您只想删除蓝线,您可以使用 findall
检索线对象的句柄,然后 delete
它。同样基于@rayreng 的反馈,我做了它,以便该行也自动从图例中删除。
r = plotregression(rand(5,1), rand(5,1));
%// Make the legend dynamic before removing the line
legend('-DynamicLegend', 'Location', get(legend, 'Location'));
%// Remove the blue line (with the "Fit" label)
delete(findall(r, 'DisplayName', 'Fit'));
我有一个带有蓝色 (lsline
) 的回归图,我想将其消除,但我不知道如何消除。
plotregression(y.testTargets, y.outputs)
如果您只想删除蓝线,您可以使用 findall
检索线对象的句柄,然后 delete
它。同样基于@rayreng 的反馈,我做了它,以便该行也自动从图例中删除。
r = plotregression(rand(5,1), rand(5,1));
%// Make the legend dynamic before removing the line
legend('-DynamicLegend', 'Location', get(legend, 'Location'));
%// Remove the blue line (with the "Fit" label)
delete(findall(r, 'DisplayName', 'Fit'));