From fed04546facdca51037305bfd403ec296fd70a48 Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Tue, 4 Aug 2015 10:15:35 -0400 Subject: [PATCH 1/2] mep12 on multiple_figs_demo.py --- examples/pylab_examples/multiple_figs_demo.py | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/examples/pylab_examples/multiple_figs_demo.py b/examples/pylab_examples/multiple_figs_demo.py index 4874c38fd052..450961e6201a 100644 --- a/examples/pylab_examples/multiple_figs_demo.py +++ b/examples/pylab_examples/multiple_figs_demo.py @@ -1,29 +1,30 @@ -#!/usr/bin/env python # Working with multiple figure windows and subplots -from pylab import * +import matplotlib.pyplot as plt +import numpy as np -t = arange(0.0, 2.0, 0.01) -s1 = sin(2*pi*t) -s2 = sin(4*pi*t) +t = np.arange(0.0, 2.0, 0.01) +s1 = np.sin(2*np.pi*t) +s2 = np.sin(4*np.pi*t) -figure(1) -subplot(211) -plot(t, s1) -subplot(212) -plot(t, 2*s1) +plt.figure(1) +plt.subplot(211) +plt.plot(t, s1) +plt.subplot(212) +plt.plot(t, 2*s1) -figure(2) -plot(t, s2) +plt.figure(2) +plt.plot(t, s2) # now switch back to figure 1 and make some changes -figure(1) -subplot(211) -plot(t, s2, 'gs') -setp(gca(), 'xticklabels', []) +plt.figure(1) +plt.subplot(211) +plt.plot(t, s2, 'gs') +ax = plt.gca() +ax.set_xticklabels([]) -figure(1) -savefig('fig1') -figure(2) -savefig('fig2') +plt.figure(1) +plt.savefig('fig1') +plt.figure(2) +plt.savefig('fig2') -show() +plt.show() From bd35517fa960de375fe1b4048dda14e557506b5d Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Tue, 4 Aug 2015 10:28:11 -0400 Subject: [PATCH 2/2] removed plt.savefigs --- examples/pylab_examples/multiple_figs_demo.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/pylab_examples/multiple_figs_demo.py b/examples/pylab_examples/multiple_figs_demo.py index 450961e6201a..625d1bbd752a 100644 --- a/examples/pylab_examples/multiple_figs_demo.py +++ b/examples/pylab_examples/multiple_figs_demo.py @@ -22,9 +22,4 @@ ax = plt.gca() ax.set_xticklabels([]) -plt.figure(1) -plt.savefig('fig1') -plt.figure(2) -plt.savefig('fig2') - plt.show()