O'Reilly logo

Sage Beginner's Guide by Craig Finch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - calling functions

We've already seen many simple examples of calling functions. Now, we'll use the plot function to illustrate more advanced ways to call functions. Evaluate the following code:

var('x')
sinc(x) = sin(x) / x
plot(sinc, (x, -10, 10))

The result should look like this:

Time for action - calling functions

Now, let's customize our plot:

plot(sinc, x, xmin=-15, xmax=15, thickness=2, color='red',
	legend_label='sinc')

The customized plot should look like this:

Time for action - calling functions

What just happened?

In the first part of the example, we defined a callable symbolic expression that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required