필터 지우기
필터 지우기

Disabling printing underscore as subscript in figures legend inside a loop

조회 수: 58 (최근 30일)
Underscores print as subscript in figures legends. Can I disable it because I want to print the underscores as well. I need to use it inside a loop. DTAfiles.name contains all the names but also contains underscores.
DTAfiles = dir('*.DTA'); %create a list of DTA file presents in the pwd
m = {1 2 3}
k=1;
figure('Name','Example')
hold on
while k<=length(m)
plot(data(m{k}).B, data(m{k}).int, 'DisplayName', DTAfiles(m{k}).name );
k=k+1;
end
hold off
legend show
Thanks.

답변 (1개)

Steven Lord
Steven Lord 2019년 9월 27일
  댓글 수: 1
Maruan Alberto Bracci
Maruan Alberto Bracci 2019년 9월 29일
Thanks for the quick response. This solution forces me to introduce the Legend. is it possible to get the same result by acting on 'DisplayName'?

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

카테고리

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