From 3216669eb133ccb1932f7972584e3ef84837166c Mon Sep 17 00:00:00 2001 From: domspad Date: Sat, 11 Jul 2015 15:02:22 -0500 Subject: [PATCH 1/4] using plt --- examples/pylab_examples/annotation_demo2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/pylab_examples/annotation_demo2.py b/examples/pylab_examples/annotation_demo2.py index 3276a4d60d3f..0825359cac5a 100644 --- a/examples/pylab_examples/annotation_demo2.py +++ b/examples/pylab_examples/annotation_demo2.py @@ -1,10 +1,10 @@ -from matplotlib.pyplot import figure, show +import matplotlib.pyplot as plt from matplotlib.patches import Ellipse import numpy as np if 1: - fig = figure(1, figsize=(8, 5)) + fig = plt.figure(1, figsize=(8, 5)) ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-4, 3)) t = np.arange(0.0, 5.0, 0.01) @@ -80,7 +80,7 @@ if 1: - fig = figure(2) + fig = plt.figure(2) fig.clf() ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-5, 3)) @@ -150,4 +150,4 @@ ) -show() +plt.show() From 90f63f8a65b5c99fbd7669cd0e4c3dd1586f6ca0 Mon Sep 17 00:00:00 2001 From: domspad Date: Sat, 11 Jul 2015 15:05:46 -0500 Subject: [PATCH 2/4] pylab to plt --- examples/pylab_examples/annotation_demo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/pylab_examples/annotation_demo.py b/examples/pylab_examples/annotation_demo.py index e58f9cac776f..d76098287fc4 100644 --- a/examples/pylab_examples/annotation_demo.py +++ b/examples/pylab_examples/annotation_demo.py @@ -35,7 +35,7 @@ """ -from matplotlib.pyplot import figure, show +import matplotlib.pyplot as plt from matplotlib.patches import Ellipse import numpy as np @@ -43,7 +43,7 @@ if 1: # if only one location is given, the text and xypoint being # annotated are assumed to be the same - fig = figure() + fig = plt.figure() ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-3, 5)) t = np.arange(0.0, 5.0, 0.01) @@ -93,7 +93,7 @@ # example is placed in the fractional figure coordinate system. # Text keyword args like horizontal and vertical alignment are # respected - fig = figure() + fig = plt.figure() ax = fig.add_subplot(111, polar=True) r = np.arange(0, 1, 0.001) theta = 2*2*np.pi*r @@ -138,4 +138,4 @@ ax.set_xlim(-20, 20) ax.set_ylim(-20, 20) -show() +plt.show() From a7fa5d953ed405209d0ebb3c0c4ca9754491594e Mon Sep 17 00:00:00 2001 From: domspad Date: Thu, 16 Jul 2015 23:29:54 -0700 Subject: [PATCH 3/4] pep8 --- examples/pylab_examples/annotation_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pylab_examples/annotation_demo.py b/examples/pylab_examples/annotation_demo.py index d76098287fc4..5c3634aa4826 100644 --- a/examples/pylab_examples/annotation_demo.py +++ b/examples/pylab_examples/annotation_demo.py @@ -120,7 +120,7 @@ el = Ellipse((0, 0), 10, 20, facecolor='r', alpha=0.5) - fig = figure() + fig = plt.figure() ax = fig.add_subplot(111, aspect='equal') ax.add_artist(el) el.set_clip_box(ax.bbox) From 38215ef33b47a19ff0994a75a98fad449a0677f2 Mon Sep 17 00:00:00 2001 From: domspad Date: Thu, 16 Jul 2015 23:31:27 -0700 Subject: [PATCH 4/4] pep8 --- examples/pylab_examples/annotation_demo2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pylab_examples/annotation_demo2.py b/examples/pylab_examples/annotation_demo2.py index 0825359cac5a..0c2b357405fe 100644 --- a/examples/pylab_examples/annotation_demo2.py +++ b/examples/pylab_examples/annotation_demo2.py @@ -98,7 +98,7 @@ ax.annotate('fancy', xy=(2., -1), xycoords='data', xytext=(-100, 60), textcoords='offset points', size=20, - #bbox=dict(boxstyle="round", fc="0.8"), + # bbox=dict(boxstyle="round", fc="0.8"), arrowprops=dict(arrowstyle="fancy", fc="0.6", ec="none", patchB=el, @@ -108,7 +108,7 @@ ax.annotate('simple', xy=(2., -1), xycoords='data', xytext=(100, 60), textcoords='offset points', size=20, - #bbox=dict(boxstyle="round", fc="0.8"), + # bbox=dict(boxstyle="round", fc="0.8"), arrowprops=dict(arrowstyle="simple", fc="0.6", ec="none", patchB=el, @@ -118,7 +118,7 @@ ax.annotate('wedge', xy=(2., -1), xycoords='data', xytext=(-100, -100), textcoords='offset points', size=20, - #bbox=dict(boxstyle="round", fc="0.8"), + # bbox=dict(boxstyle="round", fc="0.8"), arrowprops=dict(arrowstyle="wedge,tail_width=0.7", fc="0.6", ec="none", patchB=el,