\documentclass[a4paper,12pt]{article}
\usepackage[ngerman]{babel}
\usepackage
[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pdfpages}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{filecontents}
\usepackage{color}
\usepackage{colortbl}
\definecolor{grauschwarz}{rgb}{0.45,0.45,0.45}
\definecolor{grau}{rgb}{0.6,0.6,0.6}
\definecolor{dunkelgrau}{rgb}{0.8,0.8,0.8}
\definecolor{hellgrau}{rgb}{0.95,0.95,0.95}
\begin{document}
\begin{figure}
\begin{center}
\begin{filecontents}{anzahl.dat}
Gruppe X-Position MW SD
A 1 4.7 1.5
B 2 5.4 1.8
C 3 5.6 2.4
D 4 7.1 1.2
\end{filecontents}
\begin{tikzpicture}
\begin{axis}[
title = {default},
ybar,
width=12cm,
ymin=0,
ymax=10,
bar width=20pt,
xtick=data,
xticklabels from table={anzahl.dat}{Gruppe},
]
\addplot[draw=black, fill=dunkelgrau,
error bars/.cd, y dir=both, y explicit] table [
x=X-Position,
y=MW,
y error=SD
] {anzahl.dat};
\addplot+[sharp plot] coordinates
{(0.75,4.7) (4.25,4.7)};
\end{axis}
\end{tikzpicture}
\caption{default}
\label{fig:anzahl}
\end{center}
\end{figure}
\end{document}
Lesezeichen