Trying to recreate this graph:
however mine turns out like this:
Issues that I am having:
- The curve doesn't look very smooth and even.
- Nothing I try to draw (\draw) appears in the figure, I'm trying to add the text inside the figure.
Code:
\begin{tikzpicture}
\begin{axis}[xlabel = {lowest to highest},
ylabel = {income earned},
xmin = 0,
xmax = 1,
ymin = 0,
ymax = 1
]
\addplot[smooth]{x};
\addplot[smooth, thick, label=$x$]{x^2};
\coordinate (P) at (0,0);
\node[rotate=45] (N) at (P) {lorenz curve};
\end{axis}
\end{tikzpicture}
The last part trying to draw the text node was just something I found here: TikZ diagonal text. What am I doing wrong?