First time here? Check out the FAQ!

Ask Your Question
0

Where can I find documentation for matplotlib()?

asked 3 years ago

Cheng gravatar image

updated 3 years ago

I was trying to implement the code in the answer post by ADuC812 in combine sage plot with matplotlib. The poster used called matplotlib(), however, I could not find this method anywhere.

Essentially,

g=plot(sin(x))
from matplotlib.figure import Figure
figure = Figure()
main_plot = figure.add_axes((0.2,0.2,0.7,0.7))
g.matplotlib('a.svg', figure=figure, sub=main_plot)

Is matplotlib() supposed to be part of sagemath or matplotlib? Would you provide a link to the documentation for it? Thanks in advance!

Edit: Found this: Get list of coordinates from plot object

And trying:

var('x,y')
p = implicit_plot(x^2+y^2-1,(x,-2,2),(y,-2,2),plot_points=4)
P = p.matplotlib()
type(P)

I get

<class 'matplotlib.figure.Figure'>
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 3 years ago

updated 3 years ago

The basic answer to "where can I find the documentation" is to use Sage's introspection: that is, evaluate g.matplotlib?. This method is also in the reference manual: https://doc.sagemath.org/html/en/refe.... The ref manual entry is the same thing that you get from g.matplotlib?, and it also accessible from within Sage by running browse_sage_doc(g.matplotlib) or help(g.matplotlib): same information, just formatted differently.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 3 years ago

Seen: 236 times

Last updated: Jun 09 '21