Probleme mit Darstellung einer Statistik mit pgfplot
Wie man erkennt, kann man die Zahlen auf der x-Achse nicht lesen. Ist es hier sinnvoll, die Zahlen nur bspw. in fünf Jahres-Schritten anzugeben oder kann man bspw. die Zahlen vielleicht schräg stellen, dass man sie lesen kann?
\begin{filecontents*}{tourism.csv}
Jahr,Besucher
2016-01-01,1792201
2015-01-01,1289139
2014-01-01,997556
2013-01-01,807349
2012-01-01,672773
2011-01-01,565611
2010-01-01,488622
2009-01-01,493940
2008-01-01,502300
2007-01-01,485000
2006-01-01,422280
2005-01-01,374127
2004-01-01,360392
2003-01-01,320000
2002-01-01,277900
2001-01-01,296000
2000-01-01,302900
1999-01-01,262605
1998-01-01,232219
1997-01-01,201654
1996-01-01,200835
1995-01-01,189796
1994-01-01,179241
1993-01-01,157326
1992-01-01,142560
1991-01-01,143459
1990-01-01,141718
1989-01-01,130503
1988-01-01,128823
1987-01-01,129315
1986-01-01,113528
1985-01-01,97443
1984-01-01,85290
1983-01-01,77592
1982-01-01,72600
1981-01-01,72194
1980-01-01,65921
1979-01-01,76912
1978-01-01,75700
1977-01-01,72690
1976-01-01,70180
1975-01-01,71676
1974-01-01,68476
1973-01-01,74019
1972-01-01,68026
1971-01-01,60719
1970-01-01,52908
1969-01-01,44099
1968-01-01,40447
1967-01-01,37728
1966-01-01,34733
1965-01-01,28879
1964-01-01,22969
1963-01-01,17575
1962-01-01,17249
1961-01-01,13516
1960-01-01,12806
1959-01-01,12296
1958-01-01,10111
1957-01-01,9279
1956-01-01,9517
1955-01-01,9474
1954-01-01,6843
1953-01-01,6380
1952-01-01,4823
1951-01-01,4084
1950-01-01,4383
1949-01-01,5312
\end{filecontents*}
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\begin{document}
\sffamily
\begin{tikzpicture}
\sffamily
\begin{axis}[
date ZERO=1949-01-01,
date coordinates in=x,
no marks,
width=16cm,
height=6cm,
enlargelimits=false,
xticklabel={\tiny\year},
xtick={1949-01-01,1950-01-01,1951-01-01,1952-01-01,1953-01-01,1954-01-01,1955-01-01,1956-01-01,1957-01-01,1958-01-01,1958-01-01,1959-01-01,1960-01-01,1961-01-01,1962-01-01,1963-01-01,1964-01-01,1965-01-01,1966-01-01,1967-01-01,1968-01-01,1968-01-01,1969-01-01,1970-01-01,1971-01-01,1972-01-01,1973-01-01,1974-01-01,1975-01-01,1976-01-01,1977-01-01,1978-01-01,1978-01-01,1979-01-01,1980-01-01,1981-01-01,1982-01-01,1983-01-01,1984-01-01,1985-01-01,1986-01-01,1987-01-01,1988-01-01,1988-01-01,1989-01-01,1990-01-01,1991-01-01,1992-01-01,1993-01-01,1994-01-01,1995-01-01,1996-01-01,1997-01-01,1998-01-01,1999-01-01,2000-01-01,2001-01-01,2002-01-01,2003-01-01,2004-01-01,2005-01-01,2006-01-01,2007-01-01,2008-01-01,2009-01-01,2010-01-01,2011-01-01,2012-01-01,2013-01-01,2014-01-01,2015-01-01,2016-01-01},
xtick pos=left,
xtick align=outside,
% ymin=0,ymax=50,
%ytick={50,100,...,150},
ymin=0,ymax=1 500 000,
% assume math mode: nicht überprüfen ob der Mathemodus an ist
% int detect: keine Nachkommastellen für ganze Zahlen anzeigen
% 1000 sep={\,}: Kleiner Abstand zwischen 3er-Kolonnen
yticklabel={\pgfmathprintnumber[assume math mode,int detect,1000 sep={\,}]{\tick}},
% y-Achse nicht skalieren, sondern die tatsächliche Zahl im \tick angeben
scaled y ticks=false,
ytick style={draw=none},
yticklabel pos=right,
ymajorgrids=true,
legend style={
draw=none,
legend cell align=left,
at={(0,1.05)},% <-
anchor=south west,% <-
legend image code/.code={
\filldraw[##1] (-.5ex,-.5ex) rectangle (1ex,1ex);
},
},
legend columns=-1% <-
]
\addplot table[col sep=comma,x=Jahr,y={Besucher}] {tourism.csv};
\addlegendentry{Touristenzahlen pro Jahr};
\end{axis}
\end{tikzpicture}
\end{document}