{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5251","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5251/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5251/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5251/events","html_url":"https://github.com/matplotlib/matplotlib/issues/5251","id":111616521,"number":5251,"title":"Cannot use threading with Mac OSX Backend","user":{"login":"nils-werner","id":88704,"avatar_url":"https://avatars.githubusercontent.com/u/88704?v=3","gravatar_id":"","url":"https://api.github.com/users/nils-werner","html_url":"https://github.com/nils-werner","followers_url":"https://api.github.com/users/nils-werner/followers","following_url":"https://api.github.com/users/nils-werner/following{/other_user}","gists_url":"https://api.github.com/users/nils-werner/gists{/gist_id}","starred_url":"https://api.github.com/users/nils-werner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nils-werner/subscriptions","organizations_url":"https://api.github.com/users/nils-werner/orgs","repos_url":"https://api.github.com/users/nils-werner/repos","events_url":"https://api.github.com/users/nils-werner/events{/privacy}","received_events_url":"https://api.github.com/users/nils-werner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-10-15T13:27:58Z","updated_at":"2015-10-24T16:36:09Z","closed_at":null,"body":"The following does not work on Mac OSX:\r\n\r\n    from __future__ import division\r\n\r\n    import threading\r\n    import time\r\n    import sys\r\n    import numpy as np\r\n    import matplotlib\r\n    matplotlib.use('MacOSX')\r\n\r\n    import matplotlib.pyplot as plt\r\n\r\n\r\n    class async_worker(threading.Thread):\r\n        def __init__(self, fig, axis):\r\n            threading.Thread.__init__(self)\r\n            self.fig = fig\r\n            self.axis = axis\r\n\r\n        def run(self):\r\n            while True:\r\n                print \"Run thread\"\r\n                sys.stdout.flush()\r\n                time.sleep(0.1)\r\n\r\n\r\n    def main():\r\n        fig = plt.figure()\r\n        ax = fig.add_subplot(1, 1, 1)\r\n        ax.plot(np.random.rand(251, 1))\r\n\r\n        async_worker(fig, ax).start()\r\n        plt.show()\r\n\r\n\r\n    if __name__ == \"__main__\":\r\n        main()\r\n\r\nI expect to see \"Run thread\" repeated every 0.1 seconds, no matter if I interact with the plot or not. Instead I only see it repeat when I click and drag around in the MPL figure.\r\n\r\nWhen switching to `matplotlib.use('TkAgg')`, the second thread runs as expected."},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/150831907","html_url":"https://github.com/matplotlib/matplotlib/issues/5251#issuecomment-150831907","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5251","id":150831907,"user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T16:36:09Z","updated_at":"2015-10-24T16:36:09Z","body":"@mdehoon Should this be closed or left open for a more through fix?"}}