0

I want to draw following with Tikz/PGFplots:

The resulting plot

X = 0:12. Y = 0:30.

\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usepackage{float}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}
\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
\begin{figure}[H]
    \centering
    \begin{tikzpicture}
    \begin{axis}[%
    domain=0:30,
    xmin=0, xmax=30,
    ymin=0, ymax=12,
    smooth,
    axis lines = left]
    \addplot[red] {1/25000*pow(x,4)-3/2500*pow(x,3)-3/200*pow(x,2)+1/2*x+7} node[above]{$f$};
    \addplot[black] {1/50000*pow(x,4)-11/5000*pow(x,3)+29/400*pow(x,2)-3/4*x+7} node[below]{$g$};
    
    \end{axis}
    \end{tikzpicture}
\end{figure}
\end{document}

What needs to be added: the points B and C:

enter image description here

And if it is possible: removing the lines on the arrows + adding x and y above both axis. The $f$ and $g$ needs to be replaced somehow (would like them above the curves actually.

I hope you can help.

1

You can add another plot for the coordinates using a mark and point meta=explicit symbolic and nodes near coords to add "custom" labels to get:

enter image description here

Here is the modified MWE:

\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{float}

\pagestyle{empty}
\begin{document}

\begin{figure}[H]
    \centering
    \begin{tikzpicture}
      \begin{axis}[%
        domain=0:30,
        xmin=0, xmax=33,
        ymin=0, ymax=12,
        smooth,
        axis lines = left,
      ]
        \addplot[green] {1/25000*pow(x,4)-3/2500*pow(x,3)-3/200*pow(x,2)+1/2*x+7} node[above]{$f$};
        \addplot[blue] {1/50000*pow(x,4)-11/5000*pow(x,3)+29/400*pow(x,2)-3/4*x+7} node[below]{$g$};
        \addplot [
          only marks,
          mark=ball,
          mark size=2pt,
          point meta=explicit symbolic,
          nodes near coords
        ] coordinates {
            (10, 19/4) [B]
            (25, 7)    [C]
        };
      \end{axis}
    \end{tikzpicture}
\end{figure}
\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.