I would like to draw a graph as you can see it on the picture below:
All I got was this one here:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
enlargelimits=false,
xlabel=$p$,ylabel=$\pi_1$,
domain=0:1,xmin=0,xmax=1,
ymin=0,ymax=4.2,
no marks,clip=false]
\addplot[dashed] { -x+3} node[above,sloped,pos=0.2] {$\pi_1((p,1-p),T)$};
\addplot[dashed] {3*x+1} node[above,sloped,pos=0.7] {$\pi_1((p,1-p),H)$};
\addplot[red] {ifthenelse(x>0.5,-x+3,3*x+1)};
\draw[dotted,red] (axis cs:0,5/2) node[left] {$\underline{v} = \frac{5}{2}$}
-| (axis cs:0.5,0) node[below] {$\hat{p} = \frac{1}{2}$};
\end{axis}
\end{tikzpicture}
There are still things missing to make it similar to the graph I wish like to have. E.g. I do not have a label for the right axis. And there are too no arrows at the end of both axis. In addition the label is not where I want to have it. Also I was not able to put p=0
resp. p=1
where it has to be. I really wish to make it similar looking, but I do not really know how. These are my first steps in LaTeX. I hope someone may help me to solve these problems. Thank you in advance!!! (Sorry for my bad English)