Concave Function

concave

Edit and compile if you like:

\documentclass{standalone}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}
  \begin{axis}[
      domain=0:1,
      xlabel=$x$,
      smooth,
      thick,
      axis lines=left,
      every tick/.style={thick},
      legend style={cells={anchor=west}},
      legend pos=north west]

    \addplot[color=blue]{x};

    \addplot[color=red]{-x*ln(x)};

    \legend{$x$,$-x \, \ln(x)$}

  \end{axis}
\end{tikzpicture}
\end{document}

Click to download: concave.tex
Open in Overleaf: concave.tex
This file is available on tikz.netlify.app and on GitHub and is MIT licensed.
See more on the author page of Janosh Riebesell..

Leave a Reply

Your email address will not be published.