Skip to content

MPL 2.1 cannot construct figure with figsize #9366

Closed

Description

@lnevay

Bug report

Bug summary

TypeError for internal matplotlib code when constructing a figure with a specified figsize

Code for reproduction

# Paste your code here
ipython --pylab
>>> figure(figsize=(11,5))

Actual outcome

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-6b0588efc287> in <module>()
----> 1 figure(figsize=(11,5))

/Users/nevay/Library/Python/2.7/lib/python/site-packages/matplotlib/pyplot.pyc in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, clear, **kwargs)
    554         # FigureManager base class.
    555         if matplotlib.is_interactive():
--> 556             draw_if_interactive()
    557 
    558         if _INSTALL_FIG_OBSERVER:

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/decorators.pyc in wrapper(*args, **kw)
     41     def wrapper(*args,**kw):
     42         wrapper.called = False
---> 43         out = func(*args,**kw)
     44         wrapper.called = True
     45         return out

/Users/nevay/Library/Python/2.7/lib/python/site-packages/matplotlib/backend_bases.pyc in draw_if_interactive(cls)
    183             manager = Gcf.get_active()
    184             if manager:
--> 185                 cls.trigger_manager_draw(manager)
    186 
    187     @classmethod

TypeError: unbound method trigger_manager_draw() must be called with _BackendMac instance as first argument (got FigureManagerMac instance instead)

Expected outcome
A figure is constructed without error.

Matplotlib version

  • Operating system: Mac OSX 11.6
  • Matplotlib version: 2.1.0
  • Matplotlib backend (print(matplotlib.get_backend())):MacOSX
  • Python version: Python 2.7.14
  • Jupyter version (if applicable):
  • Other libraries: py27-ipython @5.4.0_0

Software installed through macports.

This seems to work with just ipython

ipython

import matplotlib.pyplot as plt
plt.figure(figsize=(11,5))
plt.show(block=False)

Activity

  1. lnevay commented on Oct 11, 2017

    @lnevay
    Author

    This happens only with the MacOSX backend. If I use TkAgg or Qt5Agg, I have no problems even with --pylab in ipython.

  2. WeatherGod commented on Oct 11, 2017

    @WeatherGod
    Member

    This is a duplicate of #9345 which was patched yesterday and will be in the upcoming bugfix release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions