Skip to content

Commit e62e365

Browse files
committed
Ensure pyplot wrapper-funcs return result
1 parent ccb78a0 commit e62e365

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

proplot/ui.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
__all__ = [
2121
'subplots',
2222
'SubplotsContainer',
23+
'show',
2324
'close',
25+
'switch_backend',
2426
'ion',
2527
'ioff',
2628
'isinteractive',
27-
'show',
28-
'switch_backend',
2929
]
3030

3131
docstring.snippets['pyplot.statement'] = """
@@ -54,72 +54,72 @@
5454

5555

5656
@docstring.add_snippets
57-
def close(*args, **kwargs):
57+
def show(*args, **kwargs):
5858
"""
59-
Call `matplotlib.pyplot.close`.
59+
Call `matplotlib.pyplot.show`.
6060
%(pyplot.statement)s
6161
6262
Parameters
6363
----------
6464
*args, **kwargs
65-
Passed to `matplotlib.pyplot.close`.
65+
Passed to `matplotlib.pyplot.show`.
6666
"""
67-
plt.close(*args, **kwargs)
67+
return plt.show(*args, **kwargs)
6868

6969

7070
@docstring.add_snippets
71-
def ion():
71+
def close(*args, **kwargs):
7272
"""
73-
Call `matplotlib.pyplot.ion`.
73+
Call `matplotlib.pyplot.close`.
7474
%(pyplot.statement)s
75+
76+
Parameters
77+
----------
78+
*args, **kwargs
79+
Passed to `matplotlib.pyplot.close`.
7580
"""
76-
plt.ion()
81+
return plt.close(*args, **kwargs)
7782

7883

7984
@docstring.add_snippets
80-
def ioff():
85+
def switch_backend(*args, **kwargs):
8186
"""
82-
Call `matplotlib.pyplot.ioff`.
87+
Call `matplotlib.pyplot.switch_backend`.
8388
%(pyplot.statement)s
89+
90+
Parameters
91+
----------
92+
*args, **kwargs
93+
Passed to `matplotlib.pyplot.switch_backend`.
8494
"""
85-
plt.ioff()
95+
return plt.switch_backend(*args, **kwargs)
8696

8797

8898
@docstring.add_snippets
89-
def isinteractive():
99+
def ion():
90100
"""
91-
Call `matplotlib.pyplot.isinteractive`.
101+
Call `matplotlib.pyplot.ion`.
92102
%(pyplot.statement)s
93103
"""
94-
plt.isinteractive()
104+
return plt.ion()
95105

96106

97107
@docstring.add_snippets
98-
def show(*args, **kwargs):
108+
def ioff():
99109
"""
100-
Call `matplotlib.pyplot.show`.
110+
Call `matplotlib.pyplot.ioff`.
101111
%(pyplot.statement)s
102-
103-
Parameters
104-
----------
105-
*args, **kwargs
106-
Passed to `matplotlib.pyplot.show`.
107112
"""
108-
plt.show(*args, **kwargs)
113+
return plt.ioff()
109114

110115

111116
@docstring.add_snippets
112-
def switch_backend(*args, **kwargs):
117+
def isinteractive():
113118
"""
114-
Call `matplotlib.pyplot.switch_backend`.
119+
Call `matplotlib.pyplot.isinteractive`.
115120
%(pyplot.statement)s
116-
117-
Parameters
118-
----------
119-
*args, **kwargs
120-
Passed to `matplotlib.pyplot.switch_backend`.
121121
"""
122-
plt.switch_backend(*args, **kwargs)
122+
return plt.isinteractive()
123123

124124

125125
def _journals(journal):

0 commit comments

Comments
 (0)