I am trying to create the picture below in Tikz. What I am most unsure of is how to make the histogram below. It does not need to have the exact same shape, but a similar shape to the histogram below. Unfortunately I don't have the underlying dataset. What is the best way to make this in Tikz?

enter image description here

  • You can produce such things easily with pgplots by adding two axis on top of each other with one being an ybar plot and the other an ordinary plot. – user121799 Jun 25 '19 at 18:35

This is to give you a start.

 \begin{axis}[ybar,bar width=2.7mm,ylabel={Number of policies},yticklabel=$\mathsf{\pgfmathprintnumber{\tick}}$,
 xticklabel=$\mathsf{\pgfmathprintnumber{\tick}}$,xlabel={Score based on \dots}]
  \addplot[samples=50,domain=0:100,fill=yellow!20] {25*x*x*x*exp(-x/10)*(0.9+0.2*rnd)};
 \begin{axis}[axis y line=right,ylabel={Actual loss ratio},xtick=\empty,ymax=200,ymin=0,
  \addplot[samples=50,domain=0:100] {180-1.6*x+20*(rnd-0.5)};

enter image description here


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.