I've been playing with the xkcd style feature in matplotlib. I have Matplotlib 1.4, and the humor sans font is installed correctly, or works in msword at least.
When I run the following example code, I get "?" instead of "-" on labels any time there should be a negative number. Any idea what causes this?
with plt.xkcd():
plt.figure()
plt.plot(np.sin(np.linspace(0, 10)))
plt.title('Whoo Hoo!!!')
Edit: At Bernie's suggestion (thanks Bernie) I tried some different backends. Tried Qt, Tkinter, and inline, and none seem to work. I'm using Ipython 2.3 btw.
Also, reputation is now high enough to post an image. As you can see everything is as expected except those pesky question marks.
eryksun comment is right. Thus, you must add the MINUS SIGN (U+2212) character to the xkcd font (hunour sans). To do so, use a font editor (I used FontForge):
I had the same problem as you and that solved it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With