Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

We are making a plot as follows:

\documentclass{standalone}

\usepackage{pgfplots}
\usetikzlibrary{calc,shadings}
\usepackage{pgfplots}

\begin{document}
    \begin{tikzpicture}
        \def\xmin{0}
        \def\xmax{10}
        \def\ymin{0}
        \def\ymax{7}
        \draw[style=help lines, ystep=1, xstep=1] ;

        \draw (-.25,-.25) node[auto] {0};
        \draw[->] (\xmin,\ymin) -- (\xmax,\ymin) node[right] {$x$};
        \draw[->] (\xmin,\ymin) -- (\xmin,\ymax) node[above] {$f(x)$};

        \def\intersectX1{2}
        \def\intersectY1{4/5+3}
        \def\intersectX2{7}
        \def\intersectY1{9/5+3}
        \def\intersectX{4.76}
        \def\intersectY{4.26}
        \def\QPX{4}
        \def\QPY{5}
        \draw[color=red,smooth] plot [domain=0:8] (\x,{((\x-4)^2)/5+3)});

        \draw[dashed]  (2,0) node[below] {$x_1$} -- (2,3.8) node[up,left] {$f(x_1)$};
        \draw[dashed]  (7,0) node[below] {$x_1$} -- (7,4.8) node[up,right] {$f(x_2)$};

        \draw[dashed,orange]  (4,0) node[below] {$\alpha\,x_1+(1-\alpha)x_2$} -- (4,3) node[below] {$f(\alpha\,x_1+(1-\alpha)x_2)$};
        \draw[color=black,dashedd] (4,3) -- (4,4.2) node[up] {$\alpha f(x_1) + (1-\alpha)f(x_2)$};
        \draw[color=blue] (2,3.8) -- (7,4.8);
    \end{tikzpicture}
\end{document}

We want to achieve:

  1. The labels $f(x_1)$, ... needs to be smaller but more clear -- by bringing more color in them.
  2. Display that : $\alpha f(x_1) + (1-\alpha)f(x_2) \ge f (\alpha x_1 + (1-\alpha) x_2)$. Just the picture need to tell the story.
  3. Any idea to beautify this plot is very welcome.

Example

share|improve this question
Why do you load pgfplots and don't use it? pgfplots provides a enhanced axis environment and addplot command for advanced plotting. See manual – bloodworks Feb 16 at 13:29
Try to avoid text over graphics? The orange color might be too light and another color might better accompany the other colors? – N.N. Feb 16 at 13:31
2  
Number 3 is too subjective for SE, please read the FAQ on don't-ask: "avoid asking subjective questions" – Camil Staps Feb 16 at 13:32
Maybe you could use pgfplots legends to put move some formulas further away from the plots? – N.N. Feb 16 at 14:03

closed as too localized by Jake, Claudio Fiandrino, Marco Daniel, diabonas, zeroth Feb 17 at 16:01

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.