2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

sans-serif; pushed image more together

This commit is contained in:
Martin Thoma 2014-09-25 10:15:17 +02:00
parent 610fe87fa4
commit b23d1217e7

View file

@ -4,31 +4,45 @@
\usepackage{pgfplots} \usepackage{pgfplots}
\usepackage{tikz} \usepackage{tikz}
\usepackage{helvet}
\usepackage[eulergreek]{sansmath}
% Sans serif fonts do not look as nice as serif fonts,
% but they are much easier to read when the image is small
\pgfplotsset{
tick label style = {font=\sansmath\sffamily},
every axis label = {font=\sansmath\sffamily},
legend style = {font=\sansmath\sffamily},
label style = {font=\sansmath\sffamily}
}
\begin{document} \begin{document}
\begin{preview} \begin{preview}
\begin{tikzpicture} \begin{tikzpicture}
\begin{axis}[ \begin{axis}[
width=15cm, title = US military budget,
height=10cm, % xlabel = Year,
title=US military budget, ylabel = In constant (2010) billion US\$,
title style={font=\bfseries}, % Display option
x tick label style={/pgf/number format/1000 sep=}, width = 12cm,
xlabel=Year, height = 10cm,
ylabel=In constant (2010) billion US\$, ymin = 340,
% enlargelimits=0.15, ymax = 760,
ymin=340, xmin = 1987,
ymax=850, xmax = 2011.9,
xmin=1987, % Configuration
xmax=2011.9, title style = {font=\bfseries},
legend style={at={(0.5,-0.15)}, x tick label style = {/pgf/number format/1000 sep=,
anchor=north,legend columns=-1}, inner sep=0pt,
ybar=5pt,% configures bar shift anchor=north east,
bar width=9pt, rotate=45 },
legend style = {at={(0.5,-0.15)},
anchor = north,legend columns=-1},
ybar = 5pt, % configures bar shift
bar width = 9pt,
nodes near coords, nodes near coords,
every node near coord/.append style={rotate=90, anchor=west}, every node near coord/.append style = {rotate=90, anchor=west, font=\small\sansmath\sffamily},
point meta=y, % the displayed number point meta = y, % the displayed number
% point meta style={rotate=90}
] ]
\addplot \addplot
coordinates {(1988, 540.415) (1989, 534.906) (1990, 510.998) coordinates {(1988, 540.415) (1989, 534.906) (1990, 510.998)
@ -38,10 +52,6 @@
(2003, 492.200) (2004, 536.459) (2005, 562.039) (2006, 570.769) (2003, 492.200) (2004, 536.459) (2005, 562.039) (2006, 570.769)
(2007, 585.749) (2008, 629.095) (2009, 679.574) (2010, 698.281) (2007, 585.749) (2008, 629.095) (2009, 679.574) (2010, 698.281)
(2011, 689.591) }; (2011, 689.591) };
% \addplot
% coordinates {(1930,38e6) (1940,42e6)
% (1950,43e6) (1960,45e6) (1970,65e6)};
% \legend{Far,Near}
\end{axis} \end{axis}
\end{tikzpicture} \end{tikzpicture}
\end{preview} \end{preview}