from pylab import *
x = linspace(0,10,100)

NameErrorTraceback (most recent call last)
<ipython-input-1-52012b99ac9a> in <module>()
----> 1 x = linspace(0,10,100)

NameError: name 'linspace' is not defined
plot(x, sin(x))
[<matplotlib.lines.Line2D at 0x7ffbaa0b3b00>]
plot(x,0.5*cos(2*x))
[<matplotlib.lines.Line2D at 0x7ffbaa099588>]
title("A matplotlib plot")
<matplotlib.text.Text at 0x7ffbaa043da0>
text(1, -0.8, "A text label")
<matplotlib.text.Text at 0x7ffba9fdbc88>
from IPython.display import HTML
import uuid

link_id = uuid.uuid4()
upload_template = """
<div id='alio-upload-element'>
    <a id='{link_id}' href='' target="_blank"/>
    <script>
        $.ajax({{
            type: "POST",
            url: "https://nb-ingest.alio.io/upload",
            dataType: 'json',
            contentType: 'application/json',
            data: JSON.stringify(IPython.notebook.toJSON()),
            success: function(data){{
                var link_element = document.getElementById('{link_id}');
                link_element.setAttribute('href', data['url']);
                link_element.click();
                var element = document.getElementById('alio-upload-element');
                element.parentNode.removeChild(element);
            }},
        }})
    </script>
</div>
 """
upload_element = upload_template.format(link_id=link_id)
HTML(upload_element)