8000 Fix print_stdout example on Python 3. · matplotlib/matplotlib@fd09cd6 · GitHub
[go: up one dir, main page]

Skip to content

Commit fd09cd6

Browse files
committed
Fix print_stdout example on Python 3.
1 parent 8d29391 commit fd09cd6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/pylab_examples/print_stdout.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99

1010
plt.plot([1, 2, 3])
1111

12-
plt.savefig(sys.stdout)
13-
plt.show()
12+
if sys.version_info[0] >= 3:
13+
plt.savefig(sys.stdout.buffer)
14+
else:
15+
plt.savefig(sys.stdout)

0 commit comments

Comments
 (0)
0