Legende eines Diagramms verschieben
Verfasst: Do 2. Nov 2017, 18:11
Hallo
Ich wollte die Legende meines Diagramms verschieben, da sonst nicht alle Linien zu sehen sind oder das Diagramm zu gross wird.
Ich habe es mit
versucht...
Wie kann ich sie nach links oben verschieben?
Ich wollte die Legende meines Diagramms verschieben, da sonst nicht alle Linien zu sehen sind oder das Diagramm zu gross wird.
Ich habe es mit
legend style={anchor=north west}
versucht...
Wie kann ich sie nach links oben verschieben?
\documentclass[fontsize=12pt]{scrreprt} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \usetikzlibrary{arrows.meta} \definecolor{myorange}{rgb}{1,0.3,0} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage{blindtext} \usepackage{showframe} \begin{document} \blindtext \begin{center} \begin{minipage}{\linewidth} \begin{tikzpicture} \pgfplotstableread{ Jahr a b c d e f g h i j k l {2011} 36 8 2 28 10 2 1 13 0 0 29 26 {2012} 37 16 2 37 9 2 1 11 0 0 26 32 {2013} 39 15 0 34 8 3 5 13 0 0 25 27 {2014} 35 15 4 35 8 3 6 11 2 0 22 28 {2015} 33 19 4 43 8 2 10 10 3 0 18 31 {2016} 32 16 6 47 9 4 11 10 5 0 22 42 {2017} 33 15 8 56 7 4 12 11 7 2 26 41 }{\data} \begin{axis}[ width=.95\textwidth, height=20cm, axis lines=left, ylabel={Anzahl}, ymin=0,ymax=70, legend style={anchor=north west} grid=major, xlabel={Jahr}, xtick=data,% <- ergänzt xticklabel style={/pgf/number format/1000 sep=} ] \addplot [myorange, mark=*] table [x=Jahr, y=a] {\data}; \addlegendentry{a} \addplot [black, mark=*] table [x=Jahr, y=b] {\data}; \addlegendentry{b} \addplot [violet, mark=*] table [x=Jahr, y=c] {\data}; \addlegendentry{c} \addplot [teal, mark=*] table [x=Jahr, y=d] {\data}; \addlegendentry{d} \addplot [purple, mark=*] table [x=Jahr, y=e] {\data}; \addlegendentry{e} \addplot [blue, mark=*] table [x=Jahr, y=f] {\data}; \addlegendentry{f} \addplot [olive, mark=*] table [x=Jahr, y=g] {\data}; \addlegendentry{g} \addplot [lime, mark=*] table [x=Jahr, y=h] {\data}; \addlegendentry{h} \addplot [brown, mark=*] table [x=Jahr, y=i] {\data}; \addlegendentry{i} \addplot [magenta, mark=*] table [x=Jahr, y=j] {\data}; \addlegendentry{j} \addplot [cyan, mark=*] table [x=Jahr, y=k] {\data}; \addlegendentry{k} \addplot [gray, mark=*] table [x=Jahr, y=l] {\data}; \addlegendentry{l} \end{axis} \end{tikzpicture} \captionof{figure}{Text.} \end{minipage} \end{center} \blindtext \end{document}