legendflex position regarding x-labels

조회 수: 6 (최근 30일)
Andreas Grøvan Aspaas
Andreas Grøvan Aspaas 2019년 4월 22일
댓글: Andreas Grøvan Aspaas 2019년 4월 22일
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);
  댓글 수: 2
Andreas Grøvan Aspaas
Andreas Grøvan Aspaas 2019년 4월 22일
Yes I know. Do you mean I should not ask questions regarding File Exchange contriubtions?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by