I need to change the font from the standard cnr to Times. I tried
\usepackage{times}
but that did not change the font of the tick mark numbers on the axes. I pasted the code and an image of the output below. As is seen in the image, the digits on the axes are still formatted to cnr
, although the rest of the graph is formatted to Times
. How can I get the digits on the axes tick marks to be formatted to Times
?
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3, width=70mm, height=60mm} %use to get tight spacing of labels to tickmarks. Not enabled by default because it affects the spacing.
\usepackage[tightpage,active]{preview}
\usepackage{times}
\begin{document}
\begin{preview}
\begin{tikzpicture}
\pgfplotsset{every axis legend/.append style={
font={\tiny}}}
\begin{semilogyaxis}[
legend pos = north east,
unbounded coords=jump,
xmin=-50,
xmax=1000,
ymin=1e-5,
ymax=1e-1,
minor x tick num = {2},
tick style={color=black},
xtick={0, 300, 600, 900},
ytick={1e-2, 1e-3, 1e-4},
every tick/.append style={thin,black},
xlabel=xlabel (times),
ylabel=ylabel (times),
after end axis/.append code={
\draw[black,dotted] (axis cs:200,1e-5) -- (axis cs:200,1e-1);
\node [rotate=90,anchor=north west] at (axis cs:200, 1e-5) {\tiny{side one (times)}};
\node [rotate=90,anchor=south west] at (axis cs:200, 1e-5) {\tiny{side two (times)}};
}]
\addplot+[mark=nothing,
thin,
solid,
black
]
coordinates {(0, 5e-3) (500, 6e-2) (900, 9e-4)};
\addplot+[mark=nothing,
thin,
dashed,
black
]
coordinates {(0, 1e-3) (300, 1e-2) (1000, 3e-4)};
\end{semilogyaxis}
\end{tikzpicture}
\end{preview}
\end{document}
\usepackage{mathptmx}
or one of the other times-like math fonts. tex.ac.uk/cgi-bin/texfaq2html?label=psfchoice – Ulrike Fischer Oct 22 '12 at 12:21