legend font style, f ​​and | are very close

13 ビュー (過去 30 日間)
Leia
Leia 2021 年 7 月 8 日
コメント済み: Leia 2021 年 7 月 8 日
In the lower legend f and | are very close, but in the upper one they are far. How can i set it?
  3 件のコメント
DGM
DGM 2021 年 7 月 8 日
Is that setup identical in both cases? Obviously something is being done differently, because you have two images. I can't guess what's different.
dpb
dpb 2021 年 7 月 8 日
Obviously the difference between the two is that a blank is inserted between the f and the | in the one and not the other. It's not clear from the post what the Q? really is -- do you not see that or do you want some way to change the spacing besides inserting the blank, I suppose?
You can't change default kerning for a given font...it is what it is in the installed font.

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

採用された回答

DGM
DGM 2021 年 7 月 8 日
編集済み: DGM 2021 年 7 月 8 日
If picking a font with a better spacing behavior isn't an option, you can always try to pad it using something other than a regular space.
███ ███ hair space -- thinnest nonzero-width space -- char(8202)
███ ███ thin space -- typically 1/5 em -- char(8201)
███ ███ punctuation space -- width of narrow punctuation -- char(8200)
███ ███ figure space -- tabular width of font -- char(8199)
███ ███ 6-per em space -- 1/6 em -- char(8198)
███ ███ 4-per em space -- 1/4 em -- char(8197)
███ ███ 3-per em space -- 1/3 em -- char(8196)
███ ███ em space -- em -- char(8195)
███ ███ en space -- 1/2 em -- char(8194)
███ ███ normal #32 space -- typically 1/4 em -- char(32) (or just spacebar)
One of the thinner spaces might be narrow enough to suit, but if you have a lot of things to plot, it might be quite the hassle.
EDIT
I guess there's also LaTeX
% just one test label
h = legend({'$$\left|f\right|$$'},'interpreter','latex');
  3 件のコメント
Walter Roberson
Walter Roberson 2021 年 7 月 8 日
There are sequences for spacing in math mode. In my experience not all of them work in MATLAB, but some do.
Leia
Leia 2021 年 7 月 8 日
thank you so much!

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

その他の回答 (1 件)

Ankit
Ankit 2021 年 7 月 8 日
As per as my knowledge this is due to "FontName". Try with other FontName for e.g. Calibri etc you will see the difference.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by