File tree 3 files changed +11
-27
lines changed
3 files changed +11
-27
lines changed Original file line number Diff line number Diff line change 2
2
:mod: `matplotlib.backends.backend_wxagg `
3
3
========================================
4
4
5
- .. automodule :: matplotlib.backends.backend_wxagg
6
- :members:
7
- :undoc-members:
8
- :show-inheritance:
5
+ **NOTE ** Not included, to avoid adding a dependency to building the docs.
6
+
7
+ .. .. automodule:: matplotlib.backends.backend_wxagg
8
+ .. :members:
9
+ .. :undoc-members:
10
+ .. :show-inheritance:
Original file line number Diff line number Diff line change @@ -6,23 +6,8 @@ class MyCairoCffi(MagicMock):
6
6
__name__ = "cairocffi"
7
7
8
8
9
- class MyWX (MagicMock ):
10
- class Panel (object ):
11
- pass
12
-
13
- class ToolBar (object ):
14
- pass
15
-
16
- class Frame (object ):
17
- pass
18
-
19
- class StatusBar (object ):
20
- pass
21
-
22
-
23
9
def setup (app ):
24
10
sys .modules .update (
25
11
cairocffi = MyCairoCffi (),
26
- wx = MyWX (),
27
12
)
28
13
return {'parallel_read_safe' : True , 'parallel_write_safe' : True }
Original file line number Diff line number Diff line change 18
18
import numpy as np
19
19
20
20
from matplotlib import rcParams
21
- from matplotlib import docstring
21
+ from matplotlib import backends , docstring
22
22
from matplotlib import __version__ as _mpl_version
23
23
from matplotlib import get_backend
24
24
@@ -415,12 +415,8 @@ def show(self, warn=True):
415
415
Parameters
416
416
----------
417
417
warn : bool
418
- If ``True``, issue warning when called on a non-GUI backend
419
-
420
- Notes
421
- -----
422
- For non-GUI backends, this does nothing, in which case a warning will
423
- be issued if *warn* is ``True`` (default).
418
+ If ``True`` and we are not running headless (i.e. on Linux with an
419
+ unset DISPLAY), issue warning when called on a non-GUI backend.
424
420
"""
425
421
try :
426
422
manager = getattr (self .canvas , 'manager' )
@@ -436,7 +432,8 @@ def show(self, warn=True):
436
432
return
437
433
except NonGuiException :
438
434
pass
439
- if warn :
435
+ if (backends ._get_running_interactive_framework () != "headless"
436
+ and warn ):
440
437
warnings .warn ('Matplotlib is currently using %s, which is a '
441
438
'non-GUI backend, so cannot show the figure.'
442
439
% get_backend ())
You can’t perform that action at this time.
0 commit comments