On Jan 23, 2008, at 5:53 PM, Jason Grout wrote: > Hi everyone, > > What is the difference between x.plot() and x.show() for an object x? > For that matter, what about view()? Of course, right now it > depends on > the object, but what is the general guideline? > > I'm refactoring a patch that rlm just posted that adds show(list of > graphs) functionality to show. I'm making it so that show(list of > anything) recursively plots the items of the list and displays a tiled > array of the item plots. However, I don't know how to generically > plot > an item and get the graphic output without displaying that plot. I > can > do [i.plot() for i in list], but what about objects that don't have a > plot function, but do have a show() function?
x.plot() returns a plot object, which can be stored, composed with other plot objects, etc. x.show() actually renders the plot and shows it (e.g. in the notebook, or poping up the rendered .png, etc). Show also produces non-plot data, e.g. latexing with jsmath for symbolic expressions in the notebook. For instance, if E is an elliptic curve, E.show() is a latexed representation, while E.plot() is a plot. Recently, the __str__ command of a plot object has been modified to call self.show(). This is nice because one doesn't have to type x.plot().show() anymore, but does make things a bit more confusing, and it is a bit unsettling that just printing an object starts up an external program. I don't know about view, but I don't think that's very standard. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---