Formatting axis label latex interpreter to look like regular text
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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:
and trying:
xlabel({' ';'$\rm L_S / \bar{D}~[-]$'},'Interpreter','latex');
gives me:
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 commentaires
dpb
le 1 Déc 2021
Modifié(e) : dpb
le 1 Déc 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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Projects dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!