Axis labelling in MATLAB plot

14 ビュー (過去 30 日間)
subho
subho 2011 年 10 月 31 日
I tried to put the string Pr, m as x-axis label in MATLAB. I used the following statement:
xlabel('\textbf{Pr},textbf{\it{m}}','interpreter','latex','FontWeight','bold','FontSize',15,'FontName','Times New Roman');
Pr appears bold in the statement whereas m does not appear bold. How do I solve this problem?
Similarly for y-axis label
ylabel('${\textbf{Nu}_{\bar{x}}}{(\textbf{Gr}_{\bar{x}}^*)^-\frac{1}{6}}$','interpreter','latex','FontName','Times New Roman','Fontsize',15);
x-bar does not appear bold.
Moreover - (minus) appear as superscript whereas (1/6) does not.
Any help is highly appreciated.

回答 (2 件)

Grzegorz Knor
Grzegorz Knor 2011 年 10 月 31 日
Your LaTeX strings are incorrect, see: http://www.codecogs.com/latex/eqneditor.php
They should look something like this:
xlabel('\textbf{Pr}, \it{\textbf{m}}', 'interpreter', 'latex', 'FontWeight',...
'bold', 'FontSize', 15, 'FontName', 'Times New Roman');
ylabel('$\textbf{Nu}_{\bar{\textbf{x}}}{(\textbf{Gr}_{\bar{\textbf{x}}}^{*})}^{-\frac{1}{6}}$',... 'interpreter', 'latex', 'FontName', 'Times New Roman',... 'Fontsize',15);
  1 件のコメント
subho
subho 2011 年 10 月 31 日
If I use these strings x appears bold but it is not italicised then. How do I get rid of it?

サインインしてコメントする。


Wayne King
Wayne King 2011 年 10 月 31 日
plot(randn(100,1));
xlabel('\bf{Pr},\bf{\it{m}}');
  1 件のコメント
subho
subho 2011 年 10 月 31 日
Of course in TEX format it will work but then the problem will come in y-label. How do you give x-bar in y-label then?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by