The below picture is what I have currently: what I want is to change 4
to a
and 6
to b
; but, if I change one of them using the xticklabel
option it globally changes all x-values
to that value. There's also the issue of the xtick
height; if you see below, it goes way above the normal distribution--I tried some of the options in the "Tick-Fine Tuning" section in the manual, but they didn't work for me. I'm also trying to remove the y-axis
: one thing I tried is messing around with the axis lines*=left
option; however I wasn't able to come up with the result I wanted.
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\pgfmathdeclarefunction{gauss}{2}{%
\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
}
\begin{tikzpicture}
\begin{axis}[
no markers, domain=0:10, samples=100,
axis lines*=left,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
height=3cm, width=6cm,
xtick={4, 6}, ytick=\empty,
enlargelimits=false, clip=false, axis on top,
grid = major
]
\addplot [fill=cyan!20, draw=none, domain=4:6] {gauss(5,1)} \closedcycle;
\addplot [very thick,cyan!50!black] {gauss(5,1)};
\end{axis}
\end{tikzpicture}
\end{document}
Furthermore, I would also like to have another normal distribution in the same row: I don't know how to go about doing that.
y axis
, there are several related question, see tex.stackexchange.com/questions/296325 (axis y line=none
) for example (I googledpgfplots remove y axis
).for normal distribution
from your title because it is irrelevant to the question.