Matlab R2014a或更早版本
要增加字体大小:获取“text”类型的所有图例子项的句柄,并将其“Fontsize”属性设置为所需的值.
要增加标记大小:获取“line”类型的所有图例子项的句柄,并将其“Markersize”属性设置为所需的值.
plot(1:10, ‘o-‘);
hold on
plot(5:12, ‘r*–‘); %// example plots
h = legend(‘one plot’, ‘another plot’, ‘location’, ‘NorthWest’); %// example legend
ch = findobj(get(h,’children’), ‘type’, ‘text’); %// children of legend of type text
set(ch, ‘Fontsize’, 14); %// set value as desired
ch = findobj(get(h,’children’), ‘type’, ‘line’); %// children of legend of type line
set(ch, ‘Markersize’, 12); %// set value as desired
Matlab R2014b或更新版(HG2)
图例中元素的组织现在是不同的.以下作品:
plot(1:10, ‘o-‘);
hold on
plot(5:12, ‘r*–‘); %// example plots
[~, objh] = legend({‘one plot’, ‘another plot’}, ‘location’, ‘NorthWest’, ‘Fontsize’, 14);
%// set font size as desired
objhl = findobj(objh, ‘type’, ‘line’); %// objects of legend of type line
set(objhl, ‘Markersize’, 12); %// set marker size as desired
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/35847.html