Skip to content

lib.pylabtools.figsize : NameError when using Qt4Agg backend and %pylab magic.  #2630

@SylvainCorlay

Description

@SylvainCorlay

Hello,
When using the pylab magic with the QtAgg backend for matplotlib, function lib.pylabtools.figsize is not imported.

This is probably "by design" but it unfortunate that one has to change ones code when changing "%pylab inline" into "%pylab" to have the graphs pop up instead of being inline.

Way to reproduce:

  1. In a new ipython notebook (do not start with --pylab inline)
In [1]: %pylab inline
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.
In [2]: figsize(2,2)

No error occurs

  1. In a new ipython notebook (do not start with --pylab inline)
In [1]: %pylab
Welcome to pylab, a matplotlib-based Python environment [backend: Qt4Agg].
For more information, type 'help(pylab)'.
In [2]: figsize(2,2)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-1d42e6d441df> in <module>()
----> 1 figsize(2,2)
    NameError: name 'figsize' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions