Ask Your Question
0

Where can I find documentation for matplotlib()?

asked 2021-06-09 04:12:05 +0100

Cheng gravatar image

updated 2021-06-09 04:51:28 +0100

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'>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-09 07:05:54 +0100

updated 2021-06-09 07:07:01 +0100

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.

edit flag offensive delete link more

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: 2021-06-09 04:12:05 +0100

Seen: 206 times

Last updated: Jun 09 '21