# How to plot Box Chart with Normal Distribution Curve?

So far, I am very obsessed with Tikz though I am a newbie. I am wondering how to plot box chart with normal distribution curve as the picture below?

This screenshot is from OriginPro Galley, I dont have the original data. So I assume data like this :

(0.12,0.33,0.34,0.54,0.68.0.67,0.78,1.02,1.11,0.45) (0.13,0.34,0.37,0.33,0.41,0.45,0.47,0.43,0.67,0.87) (0.31,0.42,0.35,0.64,0.72,0.47,0.67,0.87,0.58,0.56)

Any help will be appreciated.

• Do you have the data for the dots? Please show us what you have tried.
– user194703
Commented Jan 14, 2020 at 15:34
• Hi, Schrödinger. I am so sorry for that. This screenshot is from OriginPro Galley, I dont have the original data, and I assume a set of data. I want to try it, but I dont know where to get started.
– Lerh
Commented Jan 15, 2020 at 4:28

I am not sure whether the points are Scatter plot. And it is easy to draw points. So I just plot the box chart with norm distribution curve.

It is mainly based on Rotated Normal Distribution and some boxplot settings can be found in chapter 5.12.1 of Manual.

\documentclass{article}
\usepackage{pgfplots}
\usepackage{tikz}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{statistics}

\begin{document}
\pgfmathsetmacro{\offset}{0.05}
\begin{tikzpicture}[declare function={gauss(\x,\y,\z)=\offset+1/(\y*sqrt(2*pi))*exp(-((\x-\z)^2)/(2*\y^2));}]

\begin{axis}[samples=101,smooth,height=8cm,
boxplot/draw direction=y]