I am new to LaTeX and I want to know how to plot the following function using TikZ:

y = 300 + 1000/x + 2.5x.

at the interval 0:250


Here is a version adapted from Easiest way to plot a function with PGF/TikZ.

One does not need to use \pgfmathdeclarefunction, but I find it easier to maintian code if each function is declared as such.

enter image description here



\usepackage{pgfplots}% This uses tikz
\pgfplotsset{compat=newest}% use newest version

  \pgfmathparse{300 + 1000/x + 2.5}%

\tikzset{My Line Style/.style={smooth, ultra thick, samples=400}}

\begin{axis}[unbounded coords=discard]
    \addplot[My Line Style, color=blue, domain=0:250] (\x,{Function(\x)});
|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.