Wrong offset when using math mode and subscripts in Matplotlib and OSX

后端 未结 1 1430
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-21 14:10

I have some plots where I would like to use subindices in some labels but whenever I use math mode all the labels appear shifted. Can I set some offset for all my labels? Is

相关标签:
1条回答
  • 2020-12-21 15:09

    There seems to be a bug on the MacOSX backend for Matplotlib. In order to solve it I had to switch the backend. I tried several from the FAQ (http://matplotlib.org/faq/usage_faq.html#what-is-a-backend) and I got best results using WXAgg. TkAgg was very sluggish and WX does NOT support math mode. If anyone is interested, the code to be added before importing pyplot is:

    import matplotlib
    matplotlib.use('WXAgg')
    

    This are the results (all look slightly different):

    WXAgg

    TkAgg

    WX

    0 讨论(0)
提交回复
热议问题