Ask Your Question

Revision history [back]

First of all in your code you can replace plot(point([1,1])) by point([1,1]).

And the answer is yes. All plot functions return a graphic objects that can be further manipulated. In your function you are creating a graphic but not using it at all. The following code shows what is a graphic

sage: G = point([1,1])
sage: type(G)
<class 'sage.plot.graphics.Graphics'>
sage: G    # will show the graphics

If you want that your function shows the graphic you can do

def my_graphic():
    G = point([1,1])
    G.show()

If you want that your function returns a graphic you can do

def my_graphic():
    G = point([1,1])
    return G