Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{standalone}
- usepackage{pgfplots}
- pgfplotsset{compat=newest}
- usepgfplotslibrary{fillbetween}
- begin{document}
- pgfmathdeclarefunction{gauss}{2}{% normal distribution where #1 = mu and #2 = sigma
- pgfmathparse{exp(-((x-#1)^2)/(2*#2^2))}%
- }
- begin{tikzpicture}[every axis/.style={width=4cm}]
- begin{axis}[
- name=axis6, %axis 6
- xshift = 1.15in,
- yshift = -2.5in,
- no markers, domain=-0.7:0.7, samples=100,
- %axis lines*=left,
- %xlabel=$x$,
- ylabel=$y$,
- 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=5cm, width=12cm,
- xtick={-0.7,0,0.7},
- %xticklabels={-15, 0, 15},
- %ytick={0 1},
- ymin=0,
- ymax=1.2,
- enlargelimits=false, clip=false, axis on top,
- %grid = major
- ]
- addplot [fill=gray!80, draw=none, domain=-0.7:-0.125] {gauss(0,.2)} closedcycle;
- addplot [fill=gray!80, draw=none, domain=0.125:0.7] {gauss(0,.2)} closedcycle;
- path[name path=axi] (axis cs:-0.15,0.75) -- (axis cs:0.15,0.75);
- path[name path=axj] (axis cs:-0.15,0) -- (axis cs:0.15,0);
- %from this part things go bananas :/
- % addplot [
- % thick,
- % color=gray,
- % fill=gray!80,
- % %fill opacity=0.05
- % ]
- % fill between[
- % of=axi and axj,
- % %soft clip={domain=0:1},
- % ];
- %
- % path[name path=axk] (axis cs:-0.7,0.2) -- (axis cs:-0.35,0.2);
- % path[name path=axl] (axis cs:-0.7,0) -- (axis cs:-0.35,0);
- % addplot [
- % thick,
- % color=gray,
- % fill=gray!20,
- % %fill opacity=0.05
- % ]
- % fill between[
- % of=axk and axl,
- % %soft clip={domain=0:1},
- % ];
- addplot [gray, dash dot] {gauss(-0.7,.2)};
- addplot [black, dashed] {gauss(-0.35,.2)};
- addplot [gray] {gauss(0,.2)};
- addplot [black!80] {gauss(0.35,.2)};
- addplot [black, dotted] {gauss(0.7,.2)};
- node (bar6a) at (0,1.4){};
- end{axis}
- end{tikzpicture}
- end{document}
- documentclass{standalone}
- usepackage{pgfplots}
- pgfplotsset{compat=newest}
- usepgfplotslibrary{fillbetween}
- begin{document}
- pgfmathdeclarefunction{gauss}{2}{% normal distribution where #1 = mu and #2 = sigma
- pgfmathparse{exp(-((x-#1)^2)/(2*#2^2))}%
- }
- begin{tikzpicture}[every axis/.style={width=4cm}]
- begin{axis}[
- name=axis6, %axis 6
- xshift = 1.15in,
- yshift = -2.5in,
- no markers, domain=-0.7:0.7, samples=100,
- %axis lines*=left,
- %xlabel=$x$,
- ylabel=$y$,
- 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=5cm, width=12cm,
- xtick={-0.7,0,0.7},
- %xticklabels={-15, 0, 15},
- %ytick={0 1},
- ymin=0,
- ymax=1.2,
- enlargelimits=false, clip=false, axis on top,
- %grid = major
- ]
- addplot [fill=gray!80, draw=none, domain=-0.7:-0.125] {gauss(0,.2)} closedcycle;
- addplot [fill=gray!80, draw=none, domain=0.125:0.7] {gauss(0,.2)} closedcycle;
- path[name path=axi] (axis cs:-0.15,0.75) -- (axis cs:0.15,0.75);
- path[name path=axj] (axis cs:-0.15,0) -- (axis cs:0.15,0);
- %from this part things go bananas :/
- addplot [
- thick,
- color=gray,
- fill=gray!80,
- %fill opacity=0.05
- ]
- fill between[
- of=axi and axj,
- %soft clip={domain=0:1},
- ];
- %
- % path[name path=axk] (axis cs:-0.7,0.2) -- (axis cs:-0.35,0.2);
- % path[name path=axl] (axis cs:-0.7,0) -- (axis cs:-0.35,0);
- % addplot [
- % thick,
- % color=gray,
- % fill=gray!20,
- % %fill opacity=0.05
- % ]
- % fill between[
- % of=axk and axl,
- % %soft clip={domain=0:1},
- % ];
- addplot [gray, dash dot] {gauss(-0.7,.2)};
- addplot [black, dashed] {gauss(-0.35,.2)};
- addplot [gray] {gauss(0,.2)};
- addplot [black!80] {gauss(0.35,.2)};
- addplot [black, dotted] {gauss(0.7,.2)};
- node (bar6a) at (0,1.4){};
- end{axis}
- end{tikzpicture}
- end{document}
Add Comment
Please, Sign In to add comment