Cantor-SAGE: Display image

Uwe Fechner u.fechner at
Tue Jun 7 21:17:44 CEST 2011


well, of course I am interested.
The reason is, that the plotting features of sage are a little bit limited.
For example, if I attach names to the axes of a diagram, I cannot make
them bold, and in some cases I cannot place a name under the x-achses,
only above it.

The plotting capabilities of matplotlib are much more advanced (even
though they are more difficult to use).

One way to use matplotlib with Cantor is to save these publication
quality diagrams as image files. It would help me and my supervisor a lot,
if we could use matplotlib within Cantor (one reason, we started the
transition from Maple to Cantor is, that you cannot create publication
quality diagrams with Maple. The other reason is that some mathematical
routines of Maple don't work very well (optimization), and you cannot
debug the code because it is closed source.

So it would help us a lot, if we could use Cantor, get a worksheet for
the discussion with colleagues and students, and get high quality plots
at the same time, without the need for a separate python program.

Best regards:

Uwe Fechner

On 07.06.2011 21:00, Martin Küttler wrote:
> Hi,
> one could add a way to manually include pictures in the worksheet. In
> fact, I don't think that would be too hard to do. I could try to
> implement that feature, if you are interested.
> Best regards,
> Martin Küttler
> On Tue, Jun 7, 2011 at 7:52 PM, Alexander Rieder
> <alexanderrieder at> wrote:
>> On Tuesday 07 June 2011 17:10:04 Uwe Fechner wrote:
>>>  Hello,
>>> I can display diagrams, using the plot command of sage from within
>>> a cantor worksheet.
>>> But I did not find a way yet, to display an arbitrary image file within
>>> the cantor worksheet.
>>> Has anybody an idea, how to do that?
>>> Best regards:
>>> Uwe Fechner
>> Hi,
>> I don't thing there is a clean way of doing this, as cantor only detects if
>> the command was a plot, by looking if there is a new file created in its temp
>> directory and then displays it (I didn't think there was any usecase for doing
>> anything else).
>> As a veery dirty workaround you can just copy your image into sages temp
>> directory using something like "tmpfile=tmp_filename(); cp plt.png $tmpfile".
>> best regards,
>> Alexander Rieder
>> _______________________________________________
>> kde-edu mailing list
>> kde-edu at
> _______________________________________________
> kde-edu mailing list
> kde-edu at

Uwe Fechner, M.Sc.
Delft University of Technology
Faculty of Aerospace Engineering/ASSET
Kluyverweg 1,
2629 HS Delft, The Netherlands
Phone: +31-15-27-88902

More information about the kde-edu mailing list