von esdd » Mo 23. Jun 2014, 21:58
Verschieb mit bar shift den einen plot nach links und den anderen nach rechts:
\documentclass[a4paper]{report}
\usepackage{pgfplots}%Diagramme
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[ybar,
bar shift=-7pt,
scale only axis,
axis y line*=left,% the ’*’ avoids arrow heads
ylabel=Achse1]
\addplot+[fill=red]
coordinates {(1,1) (2, 2)
(3,3) };
\end{axis}
\begin{axis}
[ybar,
bar shift=7pt,
scale only axis,
axis y line*=right,
axis x line=none,
ylabel=Achse2]
\addplot+[fill=blue]
coordinates {(1,5) (2, 6)
(3,7) };
\end{axis}
\end{tikzpicture}
\end{document}
Gruß
Elke
Verschieb mit bar shift den einen plot nach links und den anderen nach rechts:
[code]\documentclass[a4paper]{report}
\usepackage{pgfplots}%Diagramme
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[ybar,
bar shift=-7pt,
scale only axis,
axis y line*=left,% the ’*’ avoids arrow heads
ylabel=Achse1]
\addplot+[fill=red]
coordinates {(1,1) (2, 2)
(3,3) };
\end{axis}
\begin{axis}
[ybar,
bar shift=7pt,
scale only axis,
axis y line*=right,
axis x line=none,
ylabel=Achse2]
\addplot+[fill=blue]
coordinates {(1,5) (2, 6)
(3,7) };
\end{axis}
\end{tikzpicture}
\end{document}[/code]
Gruß
Elke