1

I have a tikzpicture graph.

I would like to use OpenType fonts (specifically Adobe Garamond Pro) on the axis marks.

The MWE below uses OpenType for the axis labels, legend, and title, but not for the axis marks.

Any assistance would be greatly appreciated!

MWE:

\begin{filecontents*}{data.csv}
a,b
1,1
2,2
3,3
4,4
5,5
\end{filecontents*}

\documentclass[11pt, a4paper]{book}
\usepackage{xltxtra, pgfplots, pgfplotstable, filecontents}
\setmainfont[Ligatures=TeX,Numbers={OldStyle,Proportional}]{Adobe Garamond Pro}

\begin{document}
\begin{tikzpicture}
  \centering
\begin{axis}[
title={My Plot},
xlabel={X Label},
ylabel={Y Label},
x label style={at={(axis description cs:0.5,-0.1)},anchor=north},
y label style={at={(axis description cs:0,0.5)},anchor=south},
xticklabel style={rotate=90, anchor=near xticklabel},
axis y line*=left,
axis x line*=bottom
]

\addplot[blue, mark=x] table[x=b, y=a, col sep=comma] {data.csv};
\addlegendentry{Plot 1}

\end{axis}
\end{tikzpicture}
\end{document}
1

pgfplots is using the math font to typeset tick labels. If you add the following to your document preamble, it should use your OpenType font.

\usepackage{unicode-math}
\setmathfont{Adobe Garamond Pro}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.