Text and latex interpreter in xlabel

  • MATLAB
  • Thread starter joshmccraney
  • Start date
  • #1
2,026
113
Hi PF!

I'm going insane here. How can I have the following in xlabel: ##Q \text{ (mm\sup 3/s)}##?
 

Answers and Replies

  • #2
2,026
113
Answer is here:
Code:
xlabel(['$Q$', ' (mm \textsuperscript{3}/s)'],'Interpreter','latex')
 
  • #3
13,291
7,196
Nice, thanks for sharing.

Smetimes these kinds of display issues with text drive one insane. I once had to render some funky labels in Java and discovered that display text could in fact be a string of html tags to resize, colorize, fontify (a made up word to mean change the font to a more desireable one) the text. It really made my day too.
 
  • Like
Likes joshmccraney
  • #4
1,805
1,654
Answer is here:
Or,
Till R2020b:
xlabel('$Q~\left( \mathrm{mm}^3/\mathrm{s} \right)$', 'Interpreter', 'latex')
Or, using the new Name=Value syntax introduced in R2021a,
R2021a and later:
xlabel('$Q~\left( \mathrm{mm}^3/\mathrm{s} \right)$', Interpreter='latex')
 
  • Like
Likes joshmccraney and jedishrfu

Related Threads on Text and latex interpreter in xlabel

  • Last Post
Replies
2
Views
7K
Replies
11
Views
14K
  • Last Post
Replies
2
Views
40K
  • Last Post
Replies
1
Views
6K
Replies
3
Views
16K
Replies
2
Views
14K
  • Last Post
Replies
5
Views
23K
Replies
1
Views
854
Replies
2
Views
2K
Replies
11
Views
3K
Top