Ich werde nicht glücklich mit
Beispiel: \begin{filecontents*}{GDP.csv} Jahr,Vereinigte Staaten,United Kingdom,Denmark,Finland,Iceland,Norway,Sweden,Germany,EU28 1990-01-01,1.9,0.7,1.5,0.7,1.2,1.9,0.8,5.3,.. 1991-01-01,-0.1,-1.1,1.4,-5.9,-0.2,3.1,-1.1,5.1,.. 1992-01-01,3.6,0.4,2.0,-3.3,-3.4,3.6,-1.2,1.9,.. 1993-01-01,2.7,2.5,0.0,-0.7,1.3,2.8,-2.1,-1.0,.. 1994-01-01,4.0,3.9,5.3,3.9,3.6,5.1,4.1,2.5,.. 1995-01-01,2.7,2.5,3.0,4.2,0.1,4.2,4.0,1.7,.. 1996-01-01,3.8,2.5,2.9,3.7,4.8,5.0,1.5,0.8,1.9 1997-01-01,4.5,4.0,3.3,6.3,5.5,5.3,2.9,1.8,2.9 1998-01-01,4.4,3.1,2.2,5.4,7.0,2.6,4.2,2.0,3.0 1999-01-01,4.7,3.2,2.9,4.4,3.9,2.0,4.5,2.0,3.0 2000-01-01,4.1,3.7,3.7,5.6,4.6,3.2,4.7,3.0,3.8 2001-01-01,1.0,2.5,0.8,2.6,3.9,2.1,1.6,1.7,2.2 2002-01-01,1.8,2.5,0.5,1.7,0.6,1.4,2.1,0.0,1.4 2003-01-01,2.8,3.3,0.4,2.0,2.4,0.9,2.4,-0.7,1.3 2004-01-01,3.8,2.4,2.7,3.9,8.1,4.0,4.3,1.2,2.5 2005-01-01,3.3,3.1,2.3,2.8,6.4,2.6,2.8,0.7,2.1 2006-01-01,2.7,2.5,3.9,4.1,5.0,2.4,4.7,3.7,3.3 2007-01-01,1.8,2.4,0.9,5.2,9.4,3.0,3.4,3.3,3.0 2008-01-01,-0.3,-0.5,-0.5,0.7,1.7,0.5,-0.6,1.1,0.4 2009-01-01,-2.8,-4.2,-4.9,-8.3,-6.5,-1.7,-5.2,-5.6,-4.3 2010-01-01,2.5,1.7,1.9,3.0,-3.6,0.7,6.0,4.1,2.1 2011-01-01,1.6,1.5,1.3,2.6,2.0,1.0,2.7,3.7,1.7 2012-01-01,2.2,1.5,0.2,-1.4,1.3,2.7,-0.3,0.5,-0.4 2013-01-01,1.7,2.1,0.9,-0.8,4.3,1.0,1.2,0.5,0.3 2014-01-01,2.4,3.1,1.6,-0.6,2.1,2.0,2.6,1.9,1.8 2015-01-01,2.6,2.3,1.6,0.0,4.3,2.0,4.5,1.7,2.3 2016-01-01,...,1.8,2.0,1.9,7.4,1.1,3.2,1.9,1.9 \end{filecontents*} \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} \sffamily \begin{tikzpicture} \sffamily \begin{axis}[ date ZERO=1990-01-01, date coordinates in=x, no marks, width=12cm, height=6cm, enlargelimits=false, xticklabel={\tiny\year}, xtick={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=30, ytick={0,4,...,30}, yticklabel={\pgfmathprintnumber[verbatim]{\tick}\%}, 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={Vereinigte Staaten}] {GDP.csv}; \addlegendentry{Vereinigte Staaten}; \addplot table[col sep=comma,x=Jahr,y={United Kingdom}] {GDP.csv}; \addlegendentry{United Kingdom}; \addplot table[col sep=comma,x=Jahr,y={Denmark}] {GDP.csv}; \addlegendentry{Denmark}; \addplot table[col sep=comma,x=Jahr,y={Finland}] {GDP.csv}; \addlegendentry{Finland}; \addplot table[col sep=comma,x=Jahr,y={Iceland}] {GDP.csv}; \addlegendentry{Iceland}; \addplot table[col sep=comma,x=Jahr,y={Norway}] {GDP.csv}; \addlegendentry{Norway}; \addplot table[col sep=comma,x=Jahr,y={Sweden}] {GDP.csv}; \addlegendentry{Sweden}; \addplot table[col sep=comma,x=Jahr,y={Germany}] {GDP.csv}; \addlegendentry{Germany}; \addplot table[col sep=comma,x=Jahr,y={EU28}] {GDP.csv}; \addlegendentry{EU28}; \end{axis} \end{tikzpicture} \end{document} |
Dies ist leicht der Anleitung zu entnehmen. Also einfach alle beantwortet 16 Dez '17, 03:27 Henri |