Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 621b98c commit 0d465acCopy full SHA for 0d465ac
lib/matplotlib/tests/test_backend_ps.py
@@ -24,20 +24,19 @@
24
25
26
def _test_savefig_to_stringio(format='ps', use_log=False):
27
+ fig, ax = plt.subplots()
28
buffers = [
29
six.moves.StringIO(),
30
io.StringIO(),
31
io.BytesIO()]
32
- plt.figure()
33
-
34
if use_log:
35
- plt.yscale('log')
+ ax.set_yscale('log')
36
37
- plt.plot([1, 2], [1, 2])
38
- plt.title("Déjà vu")
+ ax.plot([1, 2], [1, 2])
+ ax.set_title("Déjà vu")
39
for buffer in buffers:
40
- plt.savefig(buffer, format=format)
+ fig.savefig(buffer, format=format)
41
42
values = [x.getvalue() for x in buffers]
43
0 commit comments