PyPlot.jl icon indicating copy to clipboard operation
PyPlot.jl copied to clipboard

Cannot save figure as svg

Open kzapfe opened this issue 9 years ago • 3 comments
trafficstars

Hello stevengj and all the gang:

This may be an issue on an update on matplotlib and not here, but I do not know for sure. I have recently created some "image" (colormaps) plots on PyPlot and saved them as svg, no problem. In the same Jupyter notebook, then, I created a more complex figure, that overlays line plots over the colormap and puts various custom labels. I can save the picture as png and eps, but not as svg. I get a very unreadable error message:

LoadError: PyError (:PyObject_Call) <class 'TypeError'>
TypeError("'H�E�I�\x07H��H[A\\A]A^A_]�H���H�\x05/��\x01H�@\x08H�E�H�\x05(��\x01H�E�1�L���\x02' object is not callable",)
  File "/usr/lib64/python3.4/site-packages/matplotlib/pyplot.py", line 688, in savefig
    res = fig.savefig(*args, **kwargs)

and continues for various lines on the same vein...

Okey, new detail: I cannot save any longer the simpler figures as svg also. I swear I did not "upgraded" anything in the middle...

kzapfe avatar Feb 04 '16 20:02 kzapfe

I just tried

using PyPlot
plot(rand(10))
savefig("foo.svg")

in IJulia with Julia 0.4.3 on MacOS X, using the Matplotlib from Conda, and it works fine.

stevengj avatar Feb 04 '16 21:02 stevengj

Hi stevengj, I am pretty sure the error may be on the matplotlib side. I just ran the code at my home computer and it works there, with Julia 0.4.3 and matplotlib 1.4.3. I think at the laboratory computer there is matplotlib 1.5.0. I shall put the issue over there.

Thanks!

kzapfe avatar Feb 05 '16 00:02 kzapfe

@kzapfe, to be sure, the best thing to do would be to try it from Python (ideally with the same backend). If you still have the problem there, then it definitely can't be PyPlot.

stevengj avatar Feb 05 '16 01:02 stevengj