I have created a normalized histogram by the following code using tikzpicture
\begin{tikzpicture}
\begin{axis}[
width=\figurewidth,
height=\figureheight,
scale only axis,
xmode=log,
ymode=log,
ybar interval,
x tick label as interval=false,
xlabel = {$\boldsymbol{\nabla}\cdot{\bf u}_{int}$},
xtick={},
xtickten={-18,-16,...,4},
yticklabels={$0.0001\%$, $0.001\%$, $0.01\%$, $0.1\%$, $1\%$, $10\%$, $100\%$},
xmin=1e-17, xmax=1e+4,
ymin=1e-5,ymax=1,
grid=none,
ymajorgrids,
]
\addplot [fill=gray!90] table [x=Lower, y=Count] {
Lower Upper Count
9.9e-15 1e-14 0.1231
1e-14 1e-13 1e-15
1e-13 1e-12 0.0000
1e-12 1e-11 0.0000
1e-11 1e-10 0.0000
1e-10 1e-9 0.0000
1e-9 1e-8 0.0000
1e-8 1e-7 0.0001
1e-7 1e-6 0.0001
1e-6 1e-5 0.0004
1e-5 1e-4 0.0010
1e-4 1e-3 0.0048
1e-3 1e-2 0.0313
1e-2 1e-1 0.1562
1e-1 1e+0 0.3464
1e+0 1e+1 0.2684
1e+1 1e+2 0.0645
1e+2 1e+3 0.0036
1e+3 1e+4 1e-15
};
\end{axis}
\end{tikzpicture}
This will create a figure like the following:
I have tried to overlay another histogram to the figure by adding the following code.
\addplot [fill=gray!50] table [x=Lower, y=Count] {
Lower Upper Count
1e-16 1e-15 1
};
Unfortunately, after adding the above code I will end up having the following figure.
I only want to overlay the second dataset to the existing histogram without introducing any gap between the bars. A figure similar to the following where the red bar represents the second dataset (this figure is made by myself in Photoshop not by TikZ):
Could someone help me solve this problem?
pgfplots
is used and also I was not able to generate the first plot using the code provided (compat=1.7
). – devendra Jan 10 '13 at 2:32\listfiles
in your preamble and look at the version ofpgfplots
in the.log
file. But I can say that you have a very old version. I suggest that you update it. – hpesoj626 Jan 10 '13 at 3:11pgfplots
to use\usepackage{pgfplots} \pgfplotsset{compat=1.7}
where 1.7 is the version number. Your installation sounds very old. Please update. You can also look the accompanyingpgfplots
manual which will clearly state the version you are using. Also, the MWE should be something which a person can compile without any modification. Something like the answer provided by Jake to your earlier question including documentclass, packages and\begin{document}
statements. – devendra Jan 10 '13 at 3:45