Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Backport PR #12322 on branch v3.0.x (Fix the docs build.) #12331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions doc/api/backend_wxagg_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
:mod:`matplotlib.backends.backend_wxagg`
========================================

.. automodule:: matplotlib.backends.backend_wxagg
:members:
:undoc-members:
:show-inheritance:
**NOTE** Not included, to avoid adding a dependency to building the docs.

.. .. automodule:: matplotlib.backends.backend_wxagg
.. :members:
.. :undoc-members:
.. :show-inheritance:
15 changes: 0 additions & 15 deletions doc/sphinxext/mock_gui_toolkits.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,8 @@ class MyCairoCffi(MagicMock):
__name__ = "cairocffi"


class MyWX(MagicMock):
class Panel(object):
pass

class ToolBar(object):
pass

class Frame(object):
pass

class StatusBar(object):
pass


def setup(app):
sys.modules.update(
cairocffi=MyCairoCffi(),
wx=MyWX(),
)
return {'parallel_read_safe': True, 'parallel_write_safe': True}
13 changes: 5 additions & 8 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy as np

from matplotlib import rcParams
from matplotlib import docstring
from matplotlib import backends, docstring
from matplotlib import __version__ as _mpl_version
from matplotlib import get_backend

Expand Down Expand Up @@ -421,12 +421,8 @@ def show(self, warn=True):
Parameters
----------
warn : bool
If ``True``, issue warning when called on a non-GUI backend

Notes
-----
For non-GUI backends, this does nothing, in which case a warning will
be issued if *warn* is ``True`` (default).
If ``True`` and we are not running headless (i.e. on Linux with an
unset DISPLAY), issue warning when called on a non-GUI backend.
"""
try:
manager = getattr(self.canvas, 'manager')
Expand All @@ -442,7 +438,8 @@ def show(self, warn=True):
return
except NonGuiException:
pass
if warn:
if (backends._get_running_interactive_framework() != "headless"
and warn):
warnings.warn('Matplotlib is currently using %s, which is a '
'non-GUI backend, so cannot show the figure.'
% get_backend())
Expand Down