von esdd » Mi 23. Nov 2016, 11:09
Eine Möglichkeit:
\documentclass[12pt,a4paper,oneside]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}% lädt auch tikz, xcolor, graphicx, ...
\pgfplotsset{compat=newest}% immer eine Angabe für compat machen
\begin{document}
\begin{figure}[htb]
\begin{tikzpicture}
\pgfplotsset{
every linear axis/.append style={
width = 15cm,
height = 8cm,
ybar,
symbolic x coords={Druck,alle,Bypass,Speisewasser,Rezirkulation},
xmin=Druck,
xmax=Rezirkulation,
enlarge x limits={abs=30pt},
ymin = 0,
ymax = 180,
}
}
\begin{axis}[
ylabel={y-Wett},
xtick=data,
ytick = {0,20,...,180},
% die weiteren Optionen werden für das Bespiel gar nicht gebraucht
%scaled ticks=false,
%tick label style={/pgf/number format/fixed},
%/pgf/number format/1000 sep={},
%legend style={at={(0.5,-0.15)},
%anchor=north,legend columns=-1},
]
\addplot coordinates
{
(Druck,171.481)
(Bypass,156.675)
(Speisewasser,151.896)
(Rezirkulation,147.301)
(alle,164.483)
};
\addplot coordinates
{
(Druck,145.178)
(Bypass,158.066)
(Speisewasser,167.66)
(Rezirkulation,170.765)
(alle,155.93)
};
\end{axis}
\begin{axis}[
axis lines=none
]
\addplot+[fill=blue] coordinates
{
(alle,164.483)
};
\addplot+[fill=red] coordinates
{
(alle,155.93)
};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
Eine Möglichkeit:
[code]\documentclass[12pt,a4paper,oneside]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}% lädt auch tikz, xcolor, graphicx, ...
\pgfplotsset{compat=newest}% immer eine Angabe für compat machen
\begin{document}
\begin{figure}[htb]
\begin{tikzpicture}
\pgfplotsset{
every linear axis/.append style={
width = 15cm,
height = 8cm,
ybar,
symbolic x coords={Druck,alle,Bypass,Speisewasser,Rezirkulation},
xmin=Druck,
xmax=Rezirkulation,
enlarge x limits={abs=30pt},
ymin = 0,
ymax = 180,
}
}
\begin{axis}[
ylabel={y-Wett},
xtick=data,
ytick = {0,20,...,180},
% die weiteren Optionen werden für das Bespiel gar nicht gebraucht
%scaled ticks=false,
%tick label style={/pgf/number format/fixed},
%/pgf/number format/1000 sep={},
%legend style={at={(0.5,-0.15)},
%anchor=north,legend columns=-1},
]
\addplot coordinates
{
(Druck,171.481)
(Bypass,156.675)
(Speisewasser,151.896)
(Rezirkulation,147.301)
(alle,164.483)
};
\addplot coordinates
{
(Druck,145.178)
(Bypass,158.066)
(Speisewasser,167.66)
(Rezirkulation,170.765)
(alle,155.93)
};
\end{axis}
\begin{axis}[
axis lines=none
]
\addplot+[fill=blue] coordinates
{
(alle,164.483)
};
\addplot+[fill=red] coordinates
{
(alle,155.93)
};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}[/code]