Formatting axis label latex interpreter to look like regular text
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I need to type "D bar" letter on one of my plot axes. Unicode doesn't have this letter defined, nor does it appear in the MATLAB special characters, so I tried using the latex interpreter. I get the result I want, however the formatting of this text is different than what is on all my other charts. Which is expected, but still I'd like to make them all appear the same.
To demonstrate what I mean, plotting:
xlabel({' ';'\rm L_S / D [-]'});
gives me:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/819159/image.png)
and trying:
xlabel({' ';'$\rm L_S / \bar{D}~[-]$'},'Interpreter','latex');
gives me:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/819164/image.png)
As you can see, the typeface, kerning, leading, etc. are all different between the two. I am able to plot "D bar" letter on the chart this way, however, the typography of this single chart/axis is different from all other charts I have. Is there a way to type this letter while retaining the standard, default typography?
Thanks.
4 comentarios
dpb
el 1 de Dic. de 2021
Editada: dpb
el 1 de Dic. de 2021
Actually, TMW ackhowledges it isn't possible by design...I knew I had seen something related, but couldn't recall precisely what it said so didn't want to go overboard.
It seems this information ought to be in the documentation -- what is given is almost nil and is buried as a parenthetical note in the documentation for text(*)
It is an extremely frustrating arena to delve into because there's absolutely no way to know what should and what cannot be expected to be able to do...and no useful debugging or diagnostic information so one can spend an unlimited amount of time trying to make something work that seems as though should based on the references on the web at the LaTeX link that is in the documentation because there are no boundaries listed by TMW.
It's a mess...and always has been and gets no attention it seems in trying to improve either the implementation nor the documentation to explain what is actually available.
While still consulting in anger I consequently stayed away from even trying because it was always such a time sink couldn't justify the lost billable manhours.
20 years ago and earlier I used to rail about this in enhancement suggestions and the like but finally gave this particular topic up as being futile. I think no suggestion I ever made was implemented, not even the ones to add to the documentation.
(*) What the documentation says is
"The displayed text uses the default LaTeX font style. The FontName, FontWeight, and FontAngle properties do not have an effect. To change the font style, use LaTeX markup."
I guess if your read that literally it implies can't do anything to change them, but the second sentence seems to hold out promise you can use LaTeX commands to work around the default limitations.
Respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!