Info
此问题已关闭。 请重新打开它进行编辑或回答。
Switching from matlab 2013b version to 2020b version. Legend command with line handles
2 次查看(过去 30 天)
显示 更早的评论
hello All i switched from old 2013b matlab version to new 2020b matlab version.
In my existing scripts written originally in 2013b
now i think some issue with legend comand (legend on plots identified by handles), ill try to explain
Earlier (2013b),
ep_hdl=plot(0,0,'Visible','off','Color','k');
hleg2=legend([ep_hdl,ep_hd2], {'legend_name1','legend_name2'});
%ep_hd1 and ep_hd2 are line handles
here hleg2 used to return a handle of type double and below line i.e. leg_line used to contain line handles for both line
leg_line=findobj(hleg2,'type','Line');
Now in 2020b,
%when i use same code my leg_line is empty
leg_line=findobj(hleg2,'type','Line');
2 个评论
Rik
2021-9-8
So this code was essentially retrieving the plot handles? That seems a strange way to do it, and I don't really see a good reason why this behavior existed in HG1 (or at least R2013b).
Why don't you describe what you actually want? That way you can keep focussed on reproducing the intended effect, instead of trying to fix single lines of code.
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!