0

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

1
  • 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, 2019 at 18:35

1 Answer 1

1

This is to give you a start.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16,width=18cm,height=7cm}
\begin{document}
\begin{tikzpicture}[font=\sffamily]
 \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)};
 \end{axis}
 \begin{axis}[axis y line=right,ylabel={Actual loss ratio},xtick=\empty,ymax=200,ymin=0,
 yticklabel=$\mathsf{\pgfmathprintnumber{\tick}}\,\%$]
  \addplot[samples=50,domain=0:100] {180-1.6*x+20*(rnd-0.5)};
 \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

1
  • Thank you!!!!!! Jun 25, 2019 at 20:37

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.