<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hello,<br>
    <br>
    I want to give an example for what I want to do:<br>
    The following code displays a nice graph, if executed in the sage
    notebook<br>
    in the web-browser:<br>
    <br>
    <style type="text/css">p, li { white-space: pre-wrap; }</style>
    <pre style="margin: 0px; text-indent: 0px;">from scipy import stats</pre>
    <pre style="margin: 0px; text-indent: 0px;">import numpy as np</pre>
    <pre style="margin: 0px; text-indent: 0px;">import matplotlib.pyplot as plt</pre>
    <pre style="margin: 0px; text-indent: 0px;">rv = stats.norm(0, 1)</pre>
    <pre style="margin: 0px; text-indent: 0px;">x = np.linspace(-10,10,1000)</pre>
    <pre style="margin: 0px; text-indent: 0px;">plt.plot(x,rv.pdf(x))</pre>
    <pre style="margin: 0px; text-indent: 0px;">plt.grid(True)</pre>
    <pre style="margin: 0px; text-indent: 0px;">plt.savefig('plt.png')</pre>
    <pre style="margin: 0px; text-indent: 0px;">#plt.clf()</pre>
    <br>
    If I execute this code in Cantor, I get the output:<br>
    <br>
    <style type="text/css">p, li { white-space: pre-wrap; }</style>
    <p style="margin: 0px; text-indent: 0px;">[Line2D(_line2)]<br>
    </p>
    <p style="margin: 0px; text-indent: 0px;"><br>
      Is there any way to get the diagram be displayed in the Cantor<br>
      worksheet?<br>
    </p>
    <p style="margin: 0px; text-indent: 0px;"><br>
      Regards:<br>
    </p>
    <p style="margin: 0px; text-indent: 0px;"><br>
      Uwe Fechner<br>
    </p>
    <br>
    <br>
    On 07.06.2011 17:10, Uwe Fechner wrote:
    <blockquote cite="mid:4DEE3F4C.2070108@tudelft.nl" type="cite">
      <pre wrap="">
 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

----------------------------------------
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

_______________________________________________
kde-edu mailing list
<a class="moz-txt-link-abbreviated" href="mailto:kde-edu@mail.kde.org">kde-edu@mail.kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/kde-edu">https://mail.kde.org/mailman/listinfo/kde-edu</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
----------------------------------------
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</pre>
  </body>
</html>