Lee Smith
Lee Smith

Reputation: 11

Sage wont allow me to add a title to a plot

I am going to put two sets of code in here the first one is the graph Im working on that has no problems. The second set of code is the same as the first except when I try to add a title to the graph I get

RuntimeError: Error in line(): option 'title' not valid.

First Set:

sage: p = plot(log(x),(x,0,10),color='green')
sage: p.axes_labels(['$x$ axis','$y$ axis'])
sage: p

Second Set:

sage: p = plot(log(x),(x,0,10),color='green',title='ln(x)')
sage: p.axes_labels(['$x$ axis','$y$ axis'])
sage: p

I have also tried p.title('ln(x)') it returned the same error.

Upvotes: 1

Views: 132

Answers (1)

kcrisman
kcrisman

Reputation: 4402

This works fine for me (in particular, the second one works), as documented at the Graphics object documentation. p.title() is not supported, though

sage: p.show(title='newtitle')

will override the old title you chose.

Which doesn't help you at all... except that this functionality is relatively new. See the original ticket, which was merged only in Sage 5.3. My suspicion is that you are using an older version of Sage. Is that possibly the issue here? In that case, it should not be too difficult to either get a new binary or even to build Sage from source - please follow up if you have any trouble with this.

Upvotes: 1

Related Questions