필터 지우기
필터 지우기

LEGEND TITLE

조회 수: 18 (최근 30일)
Ross
Ross 2012년 2월 15일
댓글: Eyal Ben-Hur 2017년 6월 23일
I am using the following command line to change the text of a figure's default legend:
legend('820mm','750mm','680mm','585mm','470mm','Location','NE');
but would like to add what the measurements relate to in a LEGEND TITLE, eg. 'Panel sizes (mm)'. Then I don't have to have 'mm' on every line and don't have to say what they measure elsewhere.
Shouldn't be difficult but can't find it in help. Would somebody kindly help please?
Thank you.

채택된 답변

Andrew Newell
Andrew Newell 2012년 2월 15일
There is a lot of information buried in layers of handle graphics. You can do the following:
hleg = legend('820mm','750mm','680mm','585mm','470mm','Location','NE');
htitle = get(hleg,'Title');
set(htitle,'String','Panel sizes (mm)')
Use get(htitle) to see a lot of other properties you can manipulate.
  댓글 수: 4
Eddy Barratt
Eddy Barratt 2016년 8월 26일
I believe there are easier options in more recent versions of MATLAB. Certainly the R2016a online documentation for legend suggests that you can simply call
title(hleg, 'Panel sizes (mm)').
Eyal Ben-Hur
Eyal Ben-Hur 2017년 6월 23일
If you get in trouble while setting the title, take a look here

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by