Skip to content

TclError in TkAgg with version 2.2.0rc1  #10479

Closed
@ImportanceOfBeingErnest

Description

Running the following minimal code in version 2.2.0rc1 (on windows 8.1, python 2.7)

import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
print matplotlib.__version__ # 2.2.0rc1

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3], [1,3,1])

plt.show()

produces a TclError: error reading data, expected ptr height width:

Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\lib-tk\Tkinter.py", line 1536, in __call__
    return self.func(*args)
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 228, in resize
    self.draw()
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 300, in draw
    tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\matplotlib\backends\tkagg.py", line 34, in blit
    dataptr, colormode, bboxptr)
TclError: error reading data, expected ptr height width
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\lib-tk\Tkinter.py", line 1536, in __call__
    return self.func(*args)
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\lib-tk\Tkinter.py", line 587, in callit
    func(*args)
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 320, in idle_draw
    self.draw()
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 300, in draw
    tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
  File "c:\winpython\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\matplotlib\backends\tkagg.py", line 34, in blit
    dataptr, colormode, bboxptr)
TclError: error reading data, expected ptr height width

Note that the error appears twice. A figure window is opened, but is empty:

image

The same code using Qt4Agg runs fine.

[I installed the the rc1 as matplotlib‑2.2.0rc1‑cp27‑cp27m‑win_amd64.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs]

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: tkRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions