pgfplots und ungleichmäßige y-Achsenverteilung

Tabellen und Grafiken erstellen und anordnen


Gast13463

pgfplots und ungleichmäßige y-Achsenverteilung

Beitrag von Gast13463 »

Hallo zusammen, mein gestapeltes Balkendiagramm funktioniert soweit, allerdings ist die y-Achse in der Nähe des Ursprungs sehr gestaucht und ich weiß nicht, wie ich die Abstände gleichmäßig von 0-24 einstelle. Hier mal mein Code
\pgfplotsset{width=12cm,compat=1.8}
%\begin{scheme}
\begin{figure}

\begin{tikzpicture}
\begin{axis}[
    ybar stacked,
   	bar width=30pt,
	nodes near coords,
    enlargelimits=0.15,
    legend style={at={(0.5,-0.20)},
      anchor=north,legend columns=-1},
    ylabel={abcdefghijk },
    symbolic x coords={2013, 2014, 2015, 2016, 
		2017},
    xtick=data,
    x tick label style={rotate=45,anchor=east},
                  ]
\addplot+[ybar] plot coordinates {(2013,12.73) (2014,12.94) 
  (2015,14.11) (2016,14.8) (2017,15.1) };
\addplot+[ybar] plot coordinates {(2013,4.59) (2014,3.91) 
  (2015,4.32) (2016,3.87) (2017,2.32) };
\addplot+[ybar] plot coordinates {(2013,1.22) (2014,1.14)
  (2015,0.98) (2016,1.03) (2017,0.71) };
\addplot+[ybar] plot coordinates {(2013,1.53) (2014,2.17) 
  (2015,2.67) (2016,2.56) (2017,2.58) };
\legend{\strut APL, \strut ABL, \strut StbL, \strut SL}
\end{axis}
\end{tikzpicture}
\caption{abcdefghijk {} }
\end{figure}
Vielen Dank für Eure Hilfe im Voraus

markusv
Forum-Meister
Forum-Meister
Beiträge: 947
Registriert: Do 3. Sep 2015, 17:20
Wohnort: Leipzig

Beitrag von markusv »

Hallo.

Witzig, wie bereits hier erwähnt: beschränke enlargelimits auf die x-Achse und füge ymin (und ggf. ymax) hinzu. Zufall oder stammen die Aufgaben aus einer gemeinsamen Quelle?
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{width=12cm,compat=1.8}
\begin{document}

%\begin{scheme}
\begin{figure}

\begin{tikzpicture}
\begin{axis}[
    ybar stacked,
      bar width=30pt,
   nodes near coords,
    enlarge x limits=0.15,
    legend style={at={(0.5,-0.20)},
      anchor=north,legend columns=-1},
    ylabel={abcdefghijk },
    symbolic x coords={2013, 2014, 2015, 2016, 
      2017},
    xtick=data,
    x tick label style={rotate=45,anchor=east},ymin=0,ymax=24
                  ]
\addplot+[ybar] plot coordinates {(2013,12.73) (2014,12.94) 
  (2015,14.11) (2016,14.8) (2017,15.1) };
\addplot+[ybar] plot coordinates {(2013,4.59) (2014,3.91) 
  (2015,4.32) (2016,3.87) (2017,2.32) };
\addplot+[ybar] plot coordinates {(2013,1.22) (2014,1.14)
  (2015,0.98) (2016,1.03) (2017,0.71) };
\addplot+[ybar] plot coordinates {(2013,1.53) (2014,2.17) 
  (2015,2.67) (2016,2.56) (2017,2.58) };
\legend{\strut APL, \strut ABL, \strut StbL, \strut SL}
\end{axis}
\end{tikzpicture}
\caption{abcdefghijk {} }
\end{figure}
\end{document}
Wäre Microsoft Word für das Schreiben von Büchern entwickelt worden,
würde es Microsoft Book heißen.

Unkomplizierte und schnelle LaTeX-Hilfe, bspw. Erstellung von Vorlagen und Bewerbungen:
Help-LaTeX@web.de

Bartman
Forum-Meister
Forum-Meister
Beiträge: 2456
Registriert: Do 16. Jul 2009, 21:41
Wohnort: Hessische Provinz

Beitrag von Bartman »

Ändere Deinen ziemlich alten Wert für compat und entferne wegen pgfplots den Ladebefehl für pgf/TiKZ.

Deaktiviere außerdem beim nächsten Beitrag mit ähnlichem Inhalt besser die Smileys.

Antworten