Hi all, First of all what I am trying to do: I am trying to make loglog plots, semilog plots, etc in Sage. I know of #4529, but it is not really helpful. There are two ways I realized I can go about doing what I want: 1. Use matplotlib directly, but then I can't interface with Sage properly. For example, the following works in the notebook and the image gets displayed: import matplotlib.pylab as Pyl Pyl.loglog(range(1,10), map(lambda i: 10^-i, range(1, 10)), 'r+', label='loglog') Pyl.legend() Pyl.savefig('./sage0.png') The downside is that the syntax is matlab syntax and is different from the one in Sage. Also, I would like to manipulate the graphics objects as easily as in Sage.
2. Modify Sage. I made a LogGraphics() class and after looking at the sources in plot and the ticket #4529, I feel I need to redefine matplotlib() so that I can make loglog plots, semilog plots, etc such that I still can work from the notebook. Also, if I do it with Sage, then I can "add" graphics easily. Problem I am facing. I have the following two lines in the beginning of my file: from sage.all import * # Just get things working for now class LogGraphics(Graphics): I don't define __init__(), the only things defined in LogGraphics are __add__(), and matplotlib() where I have removed a lot of stuff on ticks, since I don't want Sage to mess with the ticks. On running the program I get this Attribute error: AttributeError: 'LogGraphics' object has no attribute '_LogGraphics__show_axes' If I copy the __init__() from Graphics to LogGraphics then this error goes away and I instead get another error: AttributeError: 'LogGraphics' object has no attribute '_Graphics__objects' So now I am at a loss. I don't want to start reimplementing every function that is there in Graphics(). How do I make LogGraphics inherit Graphics() properly? NB: I am quite new to OOP, so I might be understanding some things wrong :) -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org