diff --git a/doc/pyplots/whats_new_98_4_legend.py b/doc/pyplots/whats_new_98_4_legend.py index 2a806126f3c..6ba35e52d12 100644 --- a/doc/pyplots/whats_new_98_4_legend.py +++ b/doc/pyplots/whats_new_98_4_legend.py @@ -1,6 +1,5 @@ import matplotlib.pyplot as plt import numpy as np -import matplotlib.pyplot as plt ax = plt.subplot(111) @@ -13,6 +12,3 @@ plt.show() - - - diff --git a/examples/lines_bars_and_markers/barh_demo.py b/examples/lines_bars_and_markers/barh_demo.py index 01993e95686..965d135b43a 100644 --- a/examples/lines_bars_and_markers/barh_demo.py +++ b/examples/lines_bars_and_markers/barh_demo.py @@ -2,11 +2,11 @@ Simple demo of a horizontal bar chart. """ import matplotlib.pyplot as plt -plt.rcdefaults() import numpy as np -import matplotlib.pyplot as plt +plt.rcdefaults() + # Example data people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') y_pos = np.arange(len(people)) diff --git a/examples/shapes_and_collections/artist_reference.py b/examples/shapes_and_collections/artist_reference.py index fc22645c642..c85a57bf654 100644 --- a/examples/shapes_and_collections/artist_reference.py +++ b/examples/shapes_and_collections/artist_reference.py @@ -9,16 +9,16 @@ BSD License """ import matplotlib.pyplot as plt -plt.rcdefaults() - import numpy as np -import matplotlib.pyplot as plt import matplotlib.path as mpath import matplotlib.lines as mlines import matplotlib.patches as mpatches from matplotlib.collections import PatchCollection +plt.rcdefaults() + + def label(xy, text): y = xy[1] - 0.15 # shift y-value for label so that it's below the artist plt.text(xy[0], y, text, ha="center", family='sans-serif', size=14) diff --git a/lib/matplotlib/_mathtext_data.py b/lib/matplotlib/_mathtext_data.py index 81e1f579f3a..000829b599d 100644 --- a/lib/matplotlib/_mathtext_data.py +++ b/lib/matplotlib/_mathtext_data.py @@ -348,7 +348,6 @@ r'\Rightarrow' : ('psyr', 222), r'\Downarrow' : ('psyr', 223), r'\Diamond' : ('psyr', 224), - r'\langle' : ('psyr', 225), r'\Sigma' : ('psyr', 229), r'\sum' : ('psyr', 229), r'\forall' : ('psyr', 34), @@ -2111,7 +2110,6 @@ 'pitchfork' : 8916, 'blacktriangleleft' : 9664, 'nprec' : 8832, - 'vdots' : 8942, 'curvearrowright' : 8631, 'barwedge' : 8892, 'multimap' : 8888, @@ -2138,7 +2136,6 @@ 'Im' : 8465, 'curvearrowleft' : 8630, 'wedgeq' : 8793, - 'fallingdotseq' : 8786, 'curlyeqprec' : 8926, 'questeq' : 8799, 'less' : 60, diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 0ab4f681986..c59332e1c7c 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -1363,14 +1363,6 @@ def pprint_setters_rest(self, prop=None, leadingspace=2): lines.append(table_formatstr) lines.append('') return lines - ######## - - for prop, path in attrs: - accepts = self.get_valid_values(prop) - name = self.aliased_name_rest(prop, path) - - lines.append('%s%s: %s' % (pad, name, accepts)) - return lines def properties(self): """ diff --git a/lib/matplotlib/backends/backend_gtkagg.py b/lib/matplotlib/backends/backend_gtkagg.py index 8acaa5a0113..eb8b4f75cab 100644 --- a/lib/matplotlib/backends/backend_gtkagg.py +++ b/lib/matplotlib/backends/backend_gtkagg.py @@ -51,8 +51,9 @@ def new_figure_manager_given_figure(num, figure): Create a new figure manager instance for the given figure. """ canvas = FigureCanvasGTKAgg(figure) - return FigureManagerGTKAgg(canvas, num) + figuremanager = FigureManagerGTKAgg(canvas, num) if DEBUG: print('backend_gtkagg.new_figure_manager done') + return figuremanager class FigureCanvasGTKAgg(FigureCanvasGTK, FigureCanvasAgg): diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index a7c56be6f25..9e46fefcbd3 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1065,12 +1065,10 @@ def validate_animation_writer_path(p): # the number of points in the legend line for scatter 'legend.scatterpoints': [3, validate_int], 'legend.fontsize': ['large', validate_fontsize], - # the relative size of legend markers vs. original - 'legend.markerscale': [1.0, validate_float], - 'legend.shadow': [False, validate_bool], - # whether or not to draw a frame around legend + + # whether or not to draw a frame around legend 'legend.frameon': [True, validate_bool], - # alpha value of the legend frame + # alpha value of the legend frame 'legend.framealpha': [None, validate_float_or_None], ## the following dimensions are in fraction of the font size diff --git a/lib/matplotlib/testing/jpl_units/__init__.py b/lib/matplotlib/testing/jpl_units/__init__.py index e371b9ac531..902766f46c2 100644 --- a/lib/matplotlib/testing/jpl_units/__init__.py +++ b/lib/matplotlib/testing/jpl_units/__init__.py @@ -40,10 +40,6 @@ from .Epoch import Epoch from .UnitDbl import UnitDbl -from .Duration import Duration -from .Epoch import Epoch -from .UnitDbl import UnitDbl - from .StrConverter import StrConverter from .EpochConverter import EpochConverter from .UnitDblConverter import UnitDblConverter diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index d23a01fd8c2..a9163dc9bd3 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -25,7 +25,6 @@ import matplotlib.pyplot as plt import matplotlib.markers as mmarkers from numpy.testing import assert_allclose, assert_array_equal -import warnings from matplotlib.cbook import IgnoredKeywordWarning import sys diff --git a/lib/matplotlib/tests/test_simplification.py b/lib/matplotlib/tests/test_simplification.py index ac0ef91f2a4..a313fdc0c97 100644 --- a/lib/matplotlib/tests/test_simplification.py +++ b/lib/matplotlib/tests/test_simplification.py @@ -8,8 +8,6 @@ from matplotlib.testing.decorators import image_comparison, knownfailureif, cleanup import matplotlib.pyplot as plt -from pylab import * -import numpy as np from matplotlib import patches, path, transforms from nose.tools import raises @@ -24,7 +22,7 @@ @image_comparison(baseline_images=['clipping'], remove_text=True) def test_clipping(): t = np.arange(0.0, 2.0, 0.01) - s = np.sin(2*pi*t) + s = np.sin(2*np.pi*t) fig = plt.figure() ax = fig.add_subplot(111) @@ -101,16 +99,16 @@ def test_simplify_curve(): def test_hatch(): fig = plt.figure() ax = fig.add_subplot(111) - ax.add_patch(Rectangle((0, 0), 1, 1, fill=False, hatch="/")) + ax.add_patch(plt.Rectangle((0, 0), 1, 1, fill=False, hatch="/")) ax.set_xlim((0.45, 0.55)) ax.set_ylim((0.45, 0.55)) @image_comparison(baseline_images=['fft_peaks'], remove_text=True) def test_fft_peaks(): fig = plt.figure() - t = arange(65536) + t = np.arange(65536) ax = fig.add_subplot(111) - p1 = ax.plot(abs(fft(sin(2*pi*.01*t)*blackman(len(t))))) + p1 = ax.plot(abs(np.fft.fft(np.sin(2*np.pi*.01*t)*np.blackman(len(t))))) path = p1[0].get_path() transform = p1[0].get_transform() @@ -163,7 +161,7 @@ def test_start_with_moveto(): @cleanup @raises(OverflowError) def test_throw_rendering_complexity_exceeded(): - rcParams['path.simplify'] = False + plt.rcParams['path.simplify'] = False xx = np.arange(200000) yy = np.random.rand(200000) yy[1000] = np.nan @@ -173,7 +171,7 @@ def test_throw_rendering_complexity_exceeded(): try: fig.savefig(io.BytesIO()) finally: - rcParams['path.simplify'] = True + plt.rcParams['path.simplify'] = True @image_comparison(baseline_images=['clipper_edge'], remove_text=True) def test_clipper(): diff --git a/lib/mpl_toolkits/axisartist/__init__.py b/lib/mpl_toolkits/axisartist/__init__.py index 74da18a64e9..d7d20e98999 100644 --- a/lib/mpl_toolkits/axisartist/__init__.py +++ b/lib/mpl_toolkits/axisartist/__init__.py @@ -4,7 +4,7 @@ from matplotlib.externals import six from .axislines import Axes, Subplot, AxesZero, SubplotZero, GridHelperRectlinear, \ - AxisArtistHelperRectlinear, AxisArtistHelper, GridHelperBase, AxisArtist + AxisArtistHelperRectlinear, AxisArtistHelper, GridHelperBase from .axis_artist import AxisArtist, GridlinesCollection from .grid_helper_curvelinear import GridHelperCurveLinear