[IPython-User] vector images in ipython notebook.

Matthias BUSSONNIER bussonniermatthias@gmail....
Thu Jun 27 02:22:42 CDT 2013


Le 27 juin 2013 à 00:50, Jon Wilson a écrit :

> Hi Matthias,
> 
> On 06/26/2013 11:19 AM, Matthias BUSSONNIER wrote:
>> you'll need dev,
>> from IPython.display import FileLink, display
>> savefile(name)
>> disaplay(FileLink(name))
>> 
>> Should adda link to the right file. ->right click download as.
> Indeed, this works, but it requires two things which are undesireable: 
> extra typing for every figure I produce, and saving the PDF rendering of 
> the figure off to a local file.

I'm not sure the extra typing is easily avoidable.
The rest of your question has been addressed by MinRK here :

http://nbviewer.ipython.org/5303304

-- 
Matthias


> 
> The local file thing is troublesome for me for a stupid reason: Our 
> collaboration's meeting-slides posting mechanism (which is a huge kludgy 
> bunch of perl CGI scripts written and modified over the course of the 
> last (at least) 12 years) archives posted files, but does not follow 
> links (not even local/relative links) in HTML when archiving.  So, if we 
> post a webpage with <img> or <a> tags that reference files in the same 
> directory, all the links and images break after archiving.  OTOH, if the 
> figures (and downloaded figures in <a> tags with the "download" 
> attribute set) are embedded in the HTML file as "data:" URIs, then 
> archiving works just fine.
> 
> There is a very nice mechanism in the notebook already whereby the 
> base64 encoded PNG or SVG data is sent to the web browser and included 
> in the page by javascript as a "data:" URI.  How does this mechanism 
> work / which files should I read to learn how it works and thus how to 
> change it to suit my purposes?  I'm working from dev from github.
> Regards,
> Jon
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20130627/6513cade/attachment-0001.html 


More information about the IPython-User mailing list