pgfplots und ungleichmäßige y-Achsenverteilung

Antwort erstellen


Diese Frage dient dazu, das automatisierte Versenden von Formularen durch Spam-Bots zu verhindern.
Smilies
:D :) :( :o :shock: :? 8) :lol: :-x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:

BBCode ist eingeschaltet
[img] ist eingeschaltet
[flash] ist ausgeschaltet
[url] ist eingeschaltet
Smilies sind eingeschaltet

Die letzten Beiträge des Themas

Ich habe die Datenschutzerklärung gelesen und bin damit einverstanden.

   

Wenn du eine Datei oder mehrere Dateien anhängen möchtest, gib die Details unten ein.

Ansicht erweitern Die letzten Beiträge des Themas: pgfplots und ungleichmäßige y-Achsenverteilung

von Bartman » Mo 11. Jun 2018, 13:47

Ä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.

von markusv » Mo 11. Jun 2018, 13:11

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}

pgfplots und ungleichmäßige y-Achsenverteilung

von Gast13463 » Mo 11. Jun 2018, 12:06

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

Nach oben