gregsexton/ob-ipython

Corrupted SVG output (wrong encoding)

Opened this issue · 0 comments

TL;DR:

Without modifications of sort (on my system), evaluating ipython code to output an svg produces a corrupted file.

Include matplotlib.rcParams['axes.unicode_minus'] = False to solve.

Long Explanation:

The problem happens ONLY when the graph goes negative and only with INLINE output.

With a plt.savefig everything is right, but there will be no automated org output.

I tracked this issue back to the fact that there is something wrong with the file formatter for the INLINE procedure.

I found out that the problem is relative to this other issue: https://stackoverflow.com/questions/30201310/use-of-hyphen-or-minus-sign-in-matplotlib-versus-compatibility-with-latex

A system-wide solution is to just include matplotlib.rcParams['axes.unicode_minus'] = False somewhere at the beginning of the chain of python source blocks.

Cheers,

NRZ