I have a frequency curve as in the figure below:
I need dashed lines that can help to estimate number that scored between 42 to 76.
My questions are
I need to draw two dashed vertical lines from 42 and 76 on the x axis. The two lines will meet the curve and will turn 90° left and hit the y axis at two respective points.
The two respective points where the dashed lines meet the y axis will be displayed, if possible, using pin command or something similar.
Kindly help me with the Tikz-PGF codes for the above two questions. Here's where I am at, currently.
Minimum Working Example
\documentclass[tikz,border=3mm]{article}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usetikzlibrary{intersections}
\pgfplotsset{compat=1.17}
\begin {document}
\begin {figure}
\begin{tikzpicture}
\begin{axis}[tick align=outside,tick pos=lower,width=15cm,
xtick={10,20,...,100},xticklabel=\empty,
minor tick style={draw=none},x tick style={draw=none},
extra x ticks={9.5,19.5,...,99.5},
extra x tick style={draw,ultra thick,grid style={draw=none},x tick style={draw},
xticklabel=\pgfmathprintnumber\tick,
xticklabel style={rotate=30}},
axis x line=bottom,axis y line=left,
xmin=9,xmax=100,xlabel=Marks,
ymin=0,ymax=55,minor tick num=4,ylabel=Cumulative frequency,
grid=both,grid style={cyan},minor grid style={help lines,cyan},
table/create on use/cumulative frequency/.style={% cf. https://tex.stackexchange.com/a/198397
create col/expr={\pgfmathaccuma + \thisrow{frequency}}
}]
\addplot[red,thick,name path=plot,smooth,mark=+,mark options={color=black}]
table [x expr=9.5+10*\coordindex,
y=cumulative frequency]{
frequency
2
3
4
6
13
10
5
3
2
2
} coordinatepos=1;
\path (0,0) coordinate (O)
(100,0) coordinate (br) (100,\pgfkeysvalueof{/pgfplots/ymax}) coordinate
(tr);
\end{axis}
\draw[-stealth] (br) -- (tr);
\path (br) -- (br|-pmax) foreach \X in {0,20,...,100}
{coordinate[pos=\X/100] (p\X)
(p\X) edge[help lines]++ (\pgfkeysvalueof{/pgfplots/minor tick length},0)
node[pos=\X/100,right,xshift=\pgfkeysvalueof{/pgfplots/minor tick length}] {\X%} };
\end{tikzpicture}
\end {figure}
\end {document}
Note: in the following thread, it was the other way round. The dashed lines originated from y axis, touched the curve and hit x axis. How to typeset a cumulative frequency curve with non-integer x axis ticks using Tikz and PGF, not pstricks
I tried to mimic the solution given in that thread but no success. Kindly help me, for I am still a newbie. I appreciate.


