Legends with multiple rows in Matlab

≡放荡痞女 提交于 2019-12-12 04:44:37

问题


How to create a legend with multiple rows or fit a legend within the plotting area. Following is my code and output plot

figure;
col = jet(numel(node_id_without_duplicates));
%legend('Node ');

for i=1:numel(node_id_without_duplicates)
    specific_node = node_id_without_duplicates(i);
    legendInfo{i} = ['Node ', num2str(specific_node)];    
    MTBF_Specific_Node; //This is the call of an another tool created by me and not included in this example. 
end    
legend(legendInfo);


回答1:


You can use gridLegend on FEX. It uses undocumented hidden axes property ScribeLegendListeners, for details please see "Multi-column (grid) legend" on Undocumented MATLAB.

I totally agree with gnovice: the plot is overloaded, rethink it to be more helpful and informative. However, if you want readers to understand nothing and say "Wow, it seems to be a hard task" the plot is just correct.



来源:https://stackoverflow.com/questions/45873868/legends-with-multiple-rows-in-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!