From 81005ee385d01fb5682c595d3e0386f97248a32f Mon Sep 17 00:00:00 2001 From: cgohlke Date: Sat, 26 Jul 2014 10:13:47 -0700 Subject: [PATCH] Fix MatplotlibDeprecationWarning: The "loc" positional argument to legend is deprecated --- examples/pylab_examples/legend_demo2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pylab_examples/legend_demo2.py b/examples/pylab_examples/legend_demo2.py index f1209eea920c..34ea2b69ee4d 100644 --- a/examples/pylab_examples/legend_demo2.py +++ b/examples/pylab_examples/legend_demo2.py @@ -13,7 +13,7 @@ l2, l3 = plt.plot(t2, np.sin(2 * np.pi * t2), '--go', t1, np.log(1 + t1), '.') l4, = plt.plot(t2, np.exp(-t2) * np.sin(2 * np.pi * t2), 'rs-.') -plt.legend( (l2, l4), ('oscillatory', 'damped'), 'upper right', shadow=True) +plt.legend( (l2, l4), ('oscillatory', 'damped'), loc='upper right', shadow=True) plt.xlabel('time') plt.ylabel('volts') plt.title('Damped oscillation')