legendflex position regarding x-labels

3 次查看(过去 30 天)
Hi
I am struggeling with the position of legendflex. It appears on top of my x-label. The x-label is visible again when I change 'buffer' to -30 for legendflex. But this results in the legend being outside of the figure when I save it to eps with export_fig.
Is there a way of extending the figure size in y direction so I am able to includ my legend in the exported figure?
figure
ba = bar(ynorm,'stacked','FaceColor','flat');
ba(2).CData = [0.5 0.5 0.5]
ba(1).CData = [0 0 1]
hatchfill2(ba(2),'single','HatchAngle',45,'HatchDensity',30,'HatchColor',[0 0 1],'HatchLineWidth',1.5);
htitle = title('Failure type normal stress');
set(htitle,'FontSize',14);
xlabel('Normal stress (kPa)');
ylabel('Failure type (%)');
yticks(0:20:100);
set(gca,'FontSize',12);
set(gca,'Color', 'none', 'XTickLabel',{'100' ,'400'});
grid on
[~,legend_h,~,~] = legendflex(ba,{'Ice layer','Ice layer and rock-ice interface'},'ref', gca,'anchor', [6 2], 'buffer', [0 -20],'color','none');
hatchfill2(legend_h(length(ba)+2),'single','HatchAngle',45,'HatchDensity',10,'HatchColor',[0 0 1],'HatchLineWidth',1.5);

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Stress and Strain 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by