# Trying to recreate a graph using Tikzpicture and Pgfplots, doesn't turn out the way I want it to

Trying to recreate this graph:

however mine turns out like this:

Issues that I am having:

1. The curve doesn't look very smooth and even.
2. 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, 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?

Something like this?

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel = {lowest to highest},
ylabel = {income earned},
xmin = 0,
xmax = 1,
ymin = 0,
ymax = 1
]
\addplot[domain=0:1,smooth, thick, label=$x$]{x^2}

• @Chisq Does that happen when you compile the above or when you embed it into another document (in which you e.g. did not say \pgfplotsset{compat=1.16})? – user121799 Apr 17 '19 at 14:36
• @Chisq It is hard for me to debug this because the above does not have the issue, nor do I know what I can do to reproduce it. There are many conceivable reasons. How about \addplot[domain=0:1]{x} node[midway,above,sloped]{Line of equality}; \node[rotate=40] at (0.5,0.4 ){Concentration area};? – user121799 Apr 17 '19 at 14:49
• @Chisq This is because pgfplots rescales both directions independently to produce a plot that has the preset width and height. You can turn this off by adding axis equal image to the options of the axis, in which case the x and y units will be the same (in this example). – user121799 Apr 17 '19 at 15:03