How do add a bar on top a letter while the letter also has a subscript
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
If I want to write the following expression on any xlabel or colorbar label:

How do I do this exactly? The following way to insert the above expression does not seem to work in MATLAB R2018 version!!!!
c2_bank_v6b2.Label.String = ["norm Prop Conc in the proppant bank" ...
"($\bar{c}$_{Prop} / $\bar{c}$_{PropMax})"];
Please and thanks. Mousumi
Accepted Answer
Walter Roberson
on 9 Aug 2018
'$\overline{C}_{Prop} / \overline{C}_{PropMax}$'
9 Comments
Mousumi Ghosh
on 9 Aug 2018
Hello Walter:
It didn't work! It looked like the following (as shown inside the circled portion of the image:

Any ideas!
Thanks. Mousumi
Walter Roberson
on 10 Aug 2018
It looks to me as if you might not have specified 'interpreter', 'latex'
Mousumi Ghosh
on 10 Aug 2018
Hello, thanks for the tip! It worked once I stated the interpreter!
I have an additional question. What is the default FontName for everything (axis labels, legends and so on)?
Thanks. Mousumi
Walter Roberson
on 10 Aug 2018
"The default font depends on the specific operating system and locale."
On my system:
>> get(0,'DefaultTextFontName')
ans =
'Helvetica'
Mousumi Ghosh
on 10 Aug 2018
Hello Walter:
Could you help me in converting the above equation (after all the bar on top and subscripts have been added) back in TeX form so that I can change the FontName?
In LaTeX mode, the text does not stand out!
Please and thanks. Mousumi
Walter Roberson
on 10 Aug 2018
Are you sure you want to change the font and not the boldness?
You can change fonts within math mode to a limited extent. See https://tex.stackexchange.com/questions/58098/what-are-all-the-font-styles-i-can-use-in-math-mode but note that it can be difficult to add a package. The ones I can get to work are
\mathrm \mathit \mathnormal \mathcal
I do not seem to find a way that works outside of latex math mode. I see hints it should be possible in tex math mode, but I do not seem to be able to get the overbar to be recognized as a single command instead of being recognized as \o followed by verbar .
Mousumi Ghosh
on 10 Aug 2018
Actually, you are correct! I want to change the boldness, but also font type would be good too! Is there a quick way to bolden the equation above?
Walter Roberson
on 10 Aug 2018
It appears you can use \mathbf
Dyuman Joshi
on 27 Mar 2024
Accepted as Walter's answer and following responses comprehensively solve the problems posed.
More Answers (0)
Categories
Find more on Title in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)