필터 지우기
필터 지우기

Greek characters on plot being truncated

조회 수: 28 (최근 30일)
Matthew Halstead
Matthew Halstead 2012년 2월 2일
답변: Nivedita 2024년 7월 23일 8:05
Hello all!
My problem is that my greek characters are being truncated when I try to use them in x- & y-axis labels. For example, the code:
ylabel('\phi [cm^2]','FontSize',14)
produces a y-axis label that looks like a lower-case phi that has been cut in half. Has anyone encountered this problem before, or can anyone tell me what I'm doing wrong? Thanks!
Update: I am using MATLAB R2010a (7.10.0.499) on Mac OS X Lion (10.7.2).
  댓글 수: 4
Tariq Alrushaid
Tariq Alrushaid 2015년 6월 16일
Did you solve the problem? I am facing the same issue with 2014a.
Guido Meneghetti
Guido Meneghetti 2024년 6월 21일
I am facing the same issue with 2023b. I found out that adding an empty subscript (e.g., \phi_{ }) solves the problem.

댓글을 달려면 로그인하십시오.

답변 (1개)

Nivedita
Nivedita 2024년 7월 23일 8:05
You can try the following alternatives to see if they resolve the issue you are facing:
1. You can specify a different font that supports Greek characters well:
ylabel('\phi [cm^2]', 'FontSize', 14, 'FontName', 'Arial')
2. You can use Unicode characters directly in your labels: (In this case, char(966) corresponds to the Unicode character for the lowercase Greek letter phi (φ).)
ylabel(char(966) + " [cm^2]", 'FontSize', 14)
3. If you prefer to use the LaTeX interpreter, ensure that it is enabled and try specifying the full LaTeX code:
ylabel('$\phi \, [cm^2]$', 'FontSize', 14, 'Interpreter', 'latex')

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by