Borrar filtros
Borrar filtros

Disabling printing underscore as subscript in figures legend inside a loop

58 visualizaciones (últimos 30 días)
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.

Respuestas (1)

Steven Lord
Steven Lord el 27 de Sept. de 2019
  1 comentario
Maruan Alberto Bracci
Maruan Alberto Bracci el 29 de Sept. de 2019
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'?

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by