I am trying to reproduce the following type of histogram. One where I can apply "shading" of a region and standard units. Any help would be greatly appreciated.

enter image description here


1 Answer 1


Just define a pic for the repeating parts and put those pics in a matrix.

\begin{tikzpicture}[declare function={gauss(\x)=exp(-\x*\x/2);},
  \path[pattern=north east lines] 
    plot[smooth,variable=\x,domain=\pv{xmin}:\pv{xmax}] ({\x},{gauss(\x)})
    |- (\pv{xmin},0);
  \draw (-2.2,0) -- (2.2,0) (2,0) -- (2,-0.2) node[below]{$2$}
  (0,-0.2) node[below]{$0$} -- (0,{gauss(0)});
  \draw[thick] plot[smooth,variable=\x,domain=-2.2:2.2] ({\x},{gauss(\x)});
\pic{fg={xmax=2}}; & \node[text depth=1cm]{$=$}; &
\pic{fg={xmax=0}}; & \node[text depth=1cm]{$+$}; &

enter image description here

  • Thanks! I tried to adjust the values in your example and produce the following examples i.imgur.com/rKVaK0w.png with no luck. If I could trouble you with once more request to make these?
    – Mr. 1.0
    Jan 30, 2020 at 5:37
  • 1
    @Mr.1.0 \matrix{ \pic{fg={xmax=-1}}; \pic{fg={xmin=1}};& \node[text depth=1cm]{$=$}; & \pic{fg={xmax=-1}}; & \node[text depth=1cm]{$+$}; & \pic{fg={xmin=1}};\\ };
    – user194703
    Jan 30, 2020 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.