Functions play an important role in mathematics. To visualize them to better understand their properties, so that we can see roots and extreme points, we can plot them in a coordinate system. In this recipe, we will see how to easily plot functions. First, let's print the polynomial function f(x) = x^3 - 5*x.
We will use the
pgfplots package, which is based on PGF/TikZ. We already used it in the previous chapter to draw various diagrams. Now it will plot a function for us. Follow these steps:
standaloneclass, which is great for creating single graphics with just a small margin, but you can choose the
articleclass or another one as ...