0

I have a code for GUI(wxPython) that plots data and that works fine on Windows 7 machine:

  • Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
  • matplotlib.get_backend() returns TkAgg as the backend
  • wx.version '4.0.1'

However, it doesn't work for Mac OS High Sierra

  • Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 12:01:12) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
  • matplotlib.get_backend() returns TkAgg as the backend
  • wx.version '4.0.1'

The symbol of python appears on the dashboard but nothing happens. No errors, no warning... nothing.

enter image description here

Valentyn
  • 659
  • 1
  • 7
  • 28

1 Answers1

0

While writing the question, I found the problem. I realized that I import libraries for WxAgg

from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FCW

Hence, it is not necessary that TkAgg backend is not working on my Mac OS High Sierra. However, I have forced backend to be WxAgg:

 matplotlib.use('WxAgg')

now the code is working fine.

Valentyn
  • 659
  • 1
  • 7
  • 28