# Modifying x-axis/y-axis with plotting

Hello,

I have been looking at the sage documentation, particularly at the plot function: http://doc.sagemath.org/html/en/refer...

I notice that in the examples they have a means of restricting the x values, like so:

plot(x^2, (x, 0, 10))


However, I can't seem to find any documentation on this feature. The function definition for the plot function does not many any mention of being able to do this, so it follows that I am not entirely sure what exactly I can do with this feature..

Can someone be of assistance in helping me figure out where this is document, if anywhere?

Additionally, is there a way then to modify the scale of the x/y axis with the plot function, or modify the steps between displayed values?

edit retag close merge delete

Sort by » oldest newest most voted

You may find this tutorial slightly more helpful. But you're right that this is not explicitly stated in the plot documentation as such. I've opened Ticket 19486 for this issue. Note that historically plotting was carried out through

sage: X = something()
sage: plot(X)
sage: X.plot()


where the latter two commands were the same, e.g. for symbolic expressions, though even there this syntax is just assumed by example.

more

Typing

sage: plot?


gives you the documentation for plot.

One of the first paragraphs in that documentation says

Type "plot.options" for a dictionary of the default options for
plots. You can change this to change the defaults for all future
plots. Use "plot.reset()" to reset to the default options.


Also, if you do

sage: p = plot(x^2, (x,0,1))


and then

sage: p?


you will get more information about Graphics objects, including how to get log scale on the axes etc.

more