Hello.
I'm trying to get an en-dash in between my SPL sub 1 and SPL sub 2 texts in xlabel, but everytime I do it doesn't work. It just gives me the normal hyphen -
I tried using 'Interpreter', 'latex') but that just messes everything up.
This is what I have: For this code matlab only gives me a hyphen between my two SPL values
xlabel('\bfSPL_{1} - \bfSPL_{2}','FontSize',12, 'FontAngle','italic')
I got the en-dash with help from per isakson; however, is there a way to make the en-dash also bold?
This is a pic of what it looks like:
bold_en-dash..PNG
Thank you for the help.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Feb. de 2019

1 voto

5 comentarios

per isakson
per isakson el 22 de Feb. de 2019
>> xlabel(['\bfSPL_{1} ', char(8211),' \bfSPL_{2}'],'FontSize',12, 'FontAngle','italic') % En-dash
>> xlabel(['\bfSPL_{1} ', char(8212),' \bfSPL_{2}'],'FontSize',12, 'FontAngle','italic') % Em-dash
JoshT_student
JoshT_student el 22 de Feb. de 2019
Thank you for the response. I did see this post; however when I try that I get error:
Code:
xlabel('\it \bfSPL_{1}' char(8211) '\bfSPL_{2}','FontSize',12)
Error:
error.PNG
Also, actually I'm trying to get the line with the text(2,4) or/and text(2,6) from the link you posted.
JoshT_student
JoshT_student el 22 de Feb. de 2019
Editada: JoshT_student el 22 de Feb. de 2019
Thanks per isakson, they work. Is there any way I can make the en-dash bold?
per isakson
per isakson el 22 de Feb. de 2019
Editada: per isakson el 22 de Feb. de 2019
I think the En-dash already is bold, and that, one my screen, I cannot distinguish a bold from a normal En-dash. Replace char(8211) by 'A' to test. Maybe some other font has a bolder en-dash.
JoshT_student
JoshT_student el 22 de Feb. de 2019
Thanks for the idea. I tried the A test and it was bold, so the En-dash must be already bold I guess. Thanks again.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Report Generator en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Preguntada:

el 22 de Feb. de 2019

Comentada:

el 22 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by