Hello,

I'd like to use a unicode character as a marker in plots created with 
PyPlot. Here is a minimal code example:

x = [ 0 1 2]
y = x
scatter(x,y,marker="\U0001F4A7")

which produces the following error:

ERROR: PyError (:PyObject_Call) <type 'exceptions.UnicodeEncodeError'>
UnicodeEncodeError('ascii', u'\U0001f4a7', 0, 1, 'ordinal not in 
range(128)')
  File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 3087, in 
scatter
    linewidths=linewidths, verts=verts, **kwargs)
  File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 6296, in 
scatter
    marker_obj = mmarkers.MarkerStyle(marker)
  File "/usr/lib/pymodules/python2.7/matplotlib/markers.py", line 162, in 
__init__
    self.set_marker(marker)
  File "/usr/lib/pymodules/python2.7/matplotlib/markers.py", line 236, in 
set_marker
    raise ValueError('Unrecognized marker style {}'.format(marker))

 [inlined code] from /home/adowling2/.julia/v0.4/PyCall/src/exception.jl:81
 in pycall at /home/adowling2/.julia/v0.4/PyCall/src/PyCall.jl:79
 in scatter at /home/adowling2/.julia/v0.4/PyPlot/src/PyPlot.jl:460

Interestingly, title("\U0001F4A7") half works. It adds a title with a box 
in place of the unicode character. I suspect this is because the default 
font does not include the character.

My questions:

   1. Any suggestions regarding the error above?
   2. Any suggestions to change the font used for the title command?

Thanks,
Alex

Reply via email to