You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Saving a figure with cyrillic title doesn't work. The next message is printed:
savefig('/tmp/тест.eps')
Traceback (most recent call last):
File "/opt/develop/lib/python3.3/site-packages/ipython-1.1.0-py3.3.egg/IPython/core/interactiveshell.py", line 2828, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
savefig('/tmp/тест.eps')
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/pyplot.py", line 561, in savefig
return fig.savefig(_args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/figure.py", line 1411, in savefig
self.canvas.print_figure(_args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_qt4agg.py", line 161, in print_figure
FigureCanvasAgg.print_figure(self, _args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backend_bases.py", line 2220, in print_figure
*_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backend_bases.py", line 1947, in print_eps
return ps.print_eps(_args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 979, in print_eps
return self._print_ps(outfile, 'eps', *args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 1007, in _print_ps
**kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 1199, in _print_figure
print_figure_impl()
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 1117, in print_figure_impl
if title: print("%%Title: "+title, file=fh)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 14-17: ordinal not in range(128)
If EPS format doesn't allow writing titles in non-ascii encodings, it may be better to leave an empty title.
The text was updated successfully, but these errors were encountered:
It is True that the metadata in Postscript is ascii (and the text itself isn't really Unicode either, but you can get a little farther with various hacks). We could use title.encode('ascii', 'replace') here. Does that successfully create a file for you?
Saving a figure with cyrillic title doesn't work. The next message is printed:
savefig('/tmp/тест.eps')
Traceback (most recent call last):
File "/opt/develop/lib/python3.3/site-packages/ipython-1.1.0-py3.3.egg/IPython/core/interactiveshell.py", line 2828, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
savefig('/tmp/тест.eps')
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/pyplot.py", line 561, in savefig
return fig.savefig(_args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/figure.py", line 1411, in savefig
self.canvas.print_figure(_args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_qt4agg.py", line 161, in print_figure
FigureCanvasAgg.print_figure(self, _args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backend_bases.py", line 2220, in print_figure
*_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backend_bases.py", line 1947, in print_eps
return ps.print_eps(_args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 979, in print_eps
return self._print_ps(outfile, 'eps', *args, *_kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 1007, in _print_ps
**kwargs)
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 1199, in _print_figure
print_figure_impl()
File "/opt/develop/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_ps.py", line 1117, in print_figure_impl
if title: print("%%Title: "+title, file=fh)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 14-17: ordinal not in range(128)
If EPS format doesn't allow writing titles in non-ascii encodings, it may be better to leave an empty title.
The text was updated successfully, but these errors were encountered: