How to include an arrow as text in the label of a plot?
Afficher commentaires plus anciens
The axes of figures for publications adhering DIN 461 respectively include an arrow that points in the same direction that the value indicated by the corresponding axis is rising, see this example. According to DIN 461, there are two options to do this: One can put the arrow either at the end of the axis or parallel to it next to the label. As I prefer the second option, how do I include an arrow as text in the label of a plot? For the abscissa, I need an arrow that points to the right, and for the ordinate, I need an arrow that points upwards. I apply 'latex' for 'Interpreter' if that matters.
Réponse acceptée
Plus de réponses (1)
plot(randn(5,1))
xlabel('X label $\rightarrow$','Interpreter','latex')
ylabel('Y label $\rightarrow$','Interpreter','latex')
2 commentaires
Simon
le 24 Fév 2026
Probably not; afaik, nobody has ever yet figured out any way to add a package to the embedded LaTeX distribution used by MATLAB.
Unless it is in the base LaTex or math symbols, I think you're stuck with what can be done inside MATLAB directly. You could possibly create an image outside of MATLAB and overlay it in the desired location sorta' like the second text object instead of inline text as used here (I didn't actually go read the doc to see the exact format spec).
If you can find the syntax to use, you can always just try and see if it is recognized by the LaTeX interpreter, but it's almost certainly not going to be unless it is in the plain vanilla base package.
Catégories
En savoir plus sur Labels and Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


