Images missing from XML/SVG export (for me) #735

Closed
aarchiba opened this Issue Aug 27, 2011 · 3 comments

3 participants

@aarchiba

When I use --pylab=inline and produce a very simple notebook with one image, both forms of HTML output work fine. But in the generated XML/SVG I get a message "Couldn't find image 8538394984452". I would guess that the backend is generating PNGs and not SVGs, and that the "Save as XML/HTML" function is not going back and regenerating them all. Asking matplotlib to generate an SVG and save it to disk yields a perfectly good SVG.

Further details: OS is Ubuntu Natty, ipython is 0.11, zeromq is 2.1.7, pyzmq is 2.1.7, all compiled and installed in my user environment. All other software is Natty standard. Machine is a core i3 laptop, ipython was run as "ipython qtconsole --pylab=inline".

ETA: I can't figure out how to either attach the broken XML notebook or get github to quote it (in spite of github's claim to use markdown). But there's not much to see; just some imports and a plot(arange(10),arange(10)), followed by the above message.

@minrk
IPython member

Yes, I believe you have to already be using SVG figures for XML+SVG export to work (SVG -> PNG conversion works, but not PNG->SVG).

To switch the qtconsole to svg figures, add:

c.InlineBackendConfig.figure_format = 'svg'

in your config file.

Or switch at runtime with:

from IPython.zmq.pylab import backend_inline
cfg = backend_inline.InlineBackendConfig.instance()
backend_inline.figure_format = 'svg'
@minrk
IPython member

Marking this as a quickfix, as the real fix in IPython should be to make the 'Couldn't find image' message describe the cause/solution more clearly, probably popping up in a dialog box after the failed export.

@takluyver takluyver closed this in c7e190d May 21, 2012
@takluyver
IPython member

@aarchiba : Thanks again for the report, this is now 'fixed' in that there's an informative error message.

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@icmurray icmurray Fixed #735. More useful error message in html output dd5e6b7
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@icmurray icmurray Added a warning dialog box when attempting to convert a PNG to SVG (#735
)
923fbdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment