von Akina » Mo 4. Jul 2016, 10:36
Hallo Zusammen,
ich versuche ein Säulendiagramm in eine Präsentation zu bringen. Mein Problem ist, dass die letzte "Gruppe" Säulen fehlt. Hier mal ein Minimalbeispiel:
\documentclass[utf8, ngerman, xcolor=table, hyperref={bookmarks=true}]{beamer}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[autostyle, german=quotes]{csquotes}
\usepackage{pgfplots}
\usepackage{tikz}
\usetheme[compress]{Singapore}
\usepackage{float}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{fit,spy}
\usetikzlibrary{patterns}
\pgfplotsset{
compat=1.9,
xlabel near ticks,
ylabel near ticks
}
\begin{document}
\begin{frame}
\small
\begin{tikzpicture}
\begin{axis}[
height=6cm,
width=10cm,
enlargelimits=0.05,
legend style={
at={(0.5,-0.3)},
anchor=north
},
ymin=0,
ymax=100,
ytick={0,10,...,100},
x tick label style={rotate=45,anchor=east},
ylabel={Anzahl},
ybar interval=0.7,
bar width=0.5cm,
symbolic x coords={30-45,60,120-240,300-540,720},
]
\addplot coordinates {
(30-45,18)
(60,27)
(120-240,43)
(300-540,17)
(720, 88)
};
\addplot coordinates {
(30-45,12)
(60,15)
(120-240,8)
(300-540,2)
(720, 6)
};
\addplot coordinates {
(30-45,6)
(60,14)
(120-240,16)
(300-540,3)
(720, 6)
};
\addplot coordinates {
(30-45,13)
(60,8)
(120-240,10)
(300-540,2)
(720, 6)
};
\legend{Aufgaben , Dummys Versuch 1, Dummys Versuch 2, Dummys Versuch 3}
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
Wie an den Daten erkennbar, sollte dort eigentlich noch eine solche Gruppe von Säulen zum Wert 720 sein.
Außerdem würde ich zwischen den Gruppen, also nach jeweils 4 Säulen gern einen etwas größeren Abstand einfügen (so wie es beispielsweise bei Excels gruppierten Säulen der Fall ist).
Vielen Dank im Voraus für Eure Hilfe :)
LG, Akina
Hallo Zusammen,
ich versuche ein Säulendiagramm in eine Präsentation zu bringen. Mein Problem ist, dass die letzte "Gruppe" Säulen fehlt. Hier mal ein Minimalbeispiel:
[code]\documentclass[utf8, ngerman, xcolor=table, hyperref={bookmarks=true}]{beamer}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[autostyle, german=quotes]{csquotes}
\usepackage{pgfplots}
\usepackage{tikz}
\usetheme[compress]{Singapore}
\usepackage{float}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{fit,spy}
\usetikzlibrary{patterns}
\pgfplotsset{
compat=1.9,
xlabel near ticks,
ylabel near ticks
}
\begin{document}
\begin{frame}
\small
\begin{tikzpicture}
\begin{axis}[
height=6cm,
width=10cm,
enlargelimits=0.05,
legend style={
at={(0.5,-0.3)},
anchor=north
},
ymin=0,
ymax=100,
ytick={0,10,...,100},
x tick label style={rotate=45,anchor=east},
ylabel={Anzahl},
ybar interval=0.7,
bar width=0.5cm,
symbolic x coords={30-45,60,120-240,300-540,720},
]
\addplot coordinates {
(30-45,18)
(60,27)
(120-240,43)
(300-540,17)
(720, 88)
};
\addplot coordinates {
(30-45,12)
(60,15)
(120-240,8)
(300-540,2)
(720, 6)
};
\addplot coordinates {
(30-45,6)
(60,14)
(120-240,16)
(300-540,3)
(720, 6)
};
\addplot coordinates {
(30-45,13)
(60,8)
(120-240,10)
(300-540,2)
(720, 6)
};
\legend{Aufgaben , Dummys Versuch 1, Dummys Versuch 2, Dummys Versuch 3}
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}[/code]
Wie an den Daten erkennbar, sollte dort eigentlich noch eine solche Gruppe von Säulen zum Wert 720 sein.
Außerdem würde ich zwischen den Gruppen, also nach jeweils 4 Säulen gern einen etwas größeren Abstand einfügen (so wie es beispielsweise bei Excels gruppierten Säulen der Fall ist).
Vielen Dank im Voraus für Eure Hilfe :)
LG, Akina