From 53fd327ee3ce09ac4f986715e00f43c1b45b0ad8 Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Tue, 5 Nov 2013 16:03:29 +0000 Subject: [PATCH] Plots are subplots rather than figures --- showstyle.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/showstyle.py b/showstyle.py index 012e29b..b80e498 100755 --- a/showstyle.py +++ b/showstyle.py @@ -45,29 +45,25 @@ def histogram(ax): ax.set_title('demo plot') ax.legend(loc='best') +fig = plt.figure(figsize=(11, 8)) def image(ax): ax.imshow(np.random.random((100, 100))) - if 'line' in args.plot or args.plot == 'all': - fig = plt.figure() - ax = fig.add_subplot(111) + ax = fig.add_subplot(221) lineplot(ax) if 'scatter' in args.plot or args.plot == 'all': - fig = plt.figure() - ax = fig.add_subplot(111) + ax = fig.add_subplot(222) scatterplot(ax) if 'hist' in args.plot or args.plot == 'all': - fig = plt.figure() - ax = fig.add_subplot(111) + ax = fig.add_subplot(223) histogram(ax) if 'image' in args.plot or args.plot == 'all': - fig = plt.figure() - ax = fig.add_subplot(111) + ax = fig.add_subplot(224) image(ax) plt.show()