Is it possible to create a plot with pgfplots with the histogram of two variables in the same chart, with a different color each?
This an example code I am using, but it creates a histogram where bars are not over each other. It has dummy data.
\documentclass{minimal}
\usepackage{pgfplots}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar interval,
xtick=,
xticklabel={$\left [ \pgfmathprintnumber\tick, \pgfmathprintnumber\nexttick \right )$},
axis x line=bottom,
axis y line=left
]
\addplot+ [hist={data=x, data max=10, data min=0}] table [row sep=\\, y index=0] {
data\\
1 \\
2 \\
3 \\
4 \\
3 \\
4 \\
5 \\
6 \\
4 \\
5 \\
6 \\
3 \\
5 \\
6 \\
7 \\
8 \\
6 \\
8 \\
8 \\
8 \\
3 \\
5 \\
8 \\
};
\addplot+ [hist={data=x, data max=10, data min=0}] table [row sep=\\, y index=0] {
data\\
1 \\
2 \\
3 \\
7 \\
8 \\
3 \\
5 \\
6 \\
3 \\
8 \\
2 \\
1 \\
6 \\
3 \\
5 \\
8 \\
};
\end{axis}
\end{tikzpicture}
\end{document}
babyboom/weightgirl.dat
etc. Even the problem ist not caused by the data it makes it easier to understand the problem if the code is processable. You could for example make up some dummy data.