在Matlab中缩小条形图图例中样本面片的大小

时间:2014-05-26 04:20:01

标签: matlab

我想减小条形图图例中样本补丁的大小,使它们是小方块。

x = rand(6,4);
B = bar(x);
BL = legend ((B([1 2 3 4])),{'one','two','three','four'},'fontsize',9);
newPosition = [0.15 0.75 0.15 0.15];
newUnits = 'normalized';
set(BL,'Position', newPosition,'Units', newUnits);

enter image description here

修改

hLegendPatch = findobj(BL, 'type', 'patch');
set(hLegendPatch, 'XData', [.2, .2, .3, .3])

enter image description here

0 个答案:

没有答案