%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20pgfplots%EC%97%90%EC%84%9C%20%EC%B6%95%2C%20%EB%A0%88%EC%9D%B4%EB%B8%94%20%EB%93%B1%EC%9D%98%20%EA%B8%80%EA%BC%B4%EC%9D%84%20%EB%B3%80%EA%B2%BD%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
Garamond
축과 레이블은 물론 텍스트에도 글꼴을 적용하여 그림을 만들어야 합니다 nodes
.
이것은 나의 MWE
:
\documentclass[12pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{fontspec}
\setmainfont{Garamond}
\begin{document}
\pgfplotsset{every axis/.append style={
line width=.5 pt,
tick style={line width=.6pt}}}
\begin{tikzpicture}
\begin{axis}[
clip mode=individual,
height=8cm,
width=10cm,
xmin=1.9,
ymin=0,
ymax=0.5,
enlarge x limits=.0,
enlarge y limits=.02,
ylabel={YLABEL},
xlabel={XLABEL},
minor x tick num=4,
minor y tick num=4,
tick label style={/pgf/number format/fixed},
every node near coord/.append style={font=\tiny},
]
\addplot[black,dashed] coordinates {(0,0) (3.4,.49)};
\addplot[black,dashed] coordinates {(0,0) (3.44,.44)};
\node[] at (axis cs: 2.7,0.2) {Text with Garamond font 1 2 3 4 5 6 7 8 9 0};
\end{axis}
\end{tikzpicture}
\end{document}
이는 다음과 같이 출력됩니다.
의 텍스트 는 글꼴을 node
사용하여 인쇄되지만 Garamond
축과 레이블은 변경되지 않습니다.
이 문제를 해결하는 간단한 방법은 무엇입니까?
답변1
두 개의 표시된 비트를 확인하세요(그렇지 않으면 기본적으로 tic 레이블이 수학 모드로 설정됩니다).
\documentclass[12pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{fontspec}
\usepackage{ebgaramond}%<=== think you needed this - you presumably have the font locally otherwise
\begin{document}
\pgfplotsset{every axis/.append style={
line width=.5 pt,
tick style={line width=.6pt}}}
\begin{tikzpicture}
\begin{axis}[
clip mode=individual,
height=8cm,
width=10cm,
xmin=1.9,
ymin=0,
ymax=0.5,
enlarge x limits=.0,
enlarge y limits=.02,
ylabel={YLABEL},
xlabel={XLABEL},
minor x tick num=4,
minor y tick num=4,
tick label style={/pgf/number format/assume math mode=true},%<=== this is what you need
every node near coord/.append style={font=\tiny},
]
\addplot[black,dashed] coordinates {(0,0) (3.4,.49)};
\addplot[black,dashed] coordinates {(0,0) (3.44,.44)};
\node[] at (axis cs: 2.7,0.2) {Text with Garamond font 1 2 3 4 5 6 7 8 9 0};
\end{axis}
\end{tikzpicture}
\end{document}