Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77d8c5f

Browse files
committed
Remove unused code
1 parent f4a8a4e commit 77d8c5f

36 files changed

+11
-68
lines changed

examples/lines_bars_and_markers/line_styles_reference.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Reference for line-styles included with Matplotlib.
77
"""
88

9-
import numpy as np
109
import matplotlib.pyplot as plt
1110

1211

lib/matplotlib/_constrained_layout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
import logging
5050
import warnings
5151

52-
from matplotlib.legend import Legend
53-
import matplotlib.transforms as transforms
5452
import matplotlib._layoutbox as layoutbox
5553

5654
_log = logging.getLogger(__name__)

lib/matplotlib/_layoutbox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import kiwisolver as kiwi
2020
import logging
2121
import numpy as np
22-
import warnings
2322

2423
import matplotlib
2524

lib/matplotlib/_pylab_helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import atexit
66
import gc
7-
import sys
87

98

109
class Gcf(object):

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333
import matplotlib.ticker as mticker
3434
import matplotlib.transforms as mtransforms
3535
import matplotlib.tri as mtri
36-
from matplotlib.cbook import (
37-
MatplotlibDeprecationWarning, warn_deprecated, STEP_LOOKUP_MAP, iterable,
38-
safe_first_element)
36+
from matplotlib.cbook import iterable
3937
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
4038
from matplotlib.axes._base import _AxesBase, _process_plot_format
4139

@@ -566,9 +564,6 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
566564

567565
if inset_ax is not None:
568566
# want to connect the indicator to the rect....
569-
570-
pos = inset_ax.get_position() # this is in fig-fraction.
571-
coordsA = 'axes fraction'
572567
connects = []
573568
xr = [bounds[0], bounds[0]+bounds[2]]
574569
yr = [bounds[1], bounds[1]+bounds[3]]
@@ -3185,7 +3180,7 @@ def extract_err(err, data):
31853180
# being accepted, when the user meant the 2xN transpose.
31863181
# special case for empty lists
31873182
if len(err) > 1:
3188-
fe = safe_first_element(err)
3183+
fe = cbook.safe_first_element(err)
31893184
if len(err) != len(data) or np.size(fe) > 1:
31903185
raise ValueError("err must be [ scalar | N, Nx1 "
31913186
"or 2xN array-like ]")
@@ -5047,7 +5042,7 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
50475042
y1slice = y1[ind0:ind1]
50485043
y2slice = y2[ind0:ind1]
50495044
if step is not None:
5050-
step_func = STEP_LOOKUP_MAP["steps-" + step]
5045+
step_func = cbook.STEP_LOOKUP_MAP["steps-" + step]
50515046
xslice, y1slice, y2slice = step_func(xslice, y1slice, y2slice)
50525047

50535048
if not len(xslice):
@@ -5230,7 +5225,7 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
52305225
x1slice = x1[ind0:ind1]
52315226
x2slice = x2[ind0:ind1]
52325227
if step is not None:
5233-
step_func = STEP_LOOKUP_MAP["steps-" + step]
5228+
step_func = cbook.STEP_LOOKUP_MAP["steps-" + step]
52345229
yslice, x1slice, x2slice = step_func(yslice, x1slice, x2slice)
52355230

52365231
if not len(yslice):

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
import matplotlib.font_manager as font_manager
2828
import matplotlib.text as mtext
2929
import matplotlib.image as mimage
30-
from matplotlib.offsetbox import OffsetBox
3130
from matplotlib.artist import allow_rasterization
32-
from matplotlib.legend import Legend
3331

3432
from matplotlib.rcsetup import cycler, validate_axisbelow
3533

lib/matplotlib/axes/_subplots.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import functools
2-
import warnings
32

43
from matplotlib import docstring
54
import matplotlib.artist as martist

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
backend_tools as tools, cbook, colors, textpath, tight_bbox, transforms,
4848
widgets, get_backend, is_interactive, rcParams)
4949
from matplotlib._pylab_helpers import Gcf
50-
from matplotlib.transforms import Bbox, TransformedBbox, Affine2D
50+
from matplotlib.transforms import Affine2D
5151
from matplotlib.path import Path
5252

5353
try:

lib/matplotlib/backends/backend_cairo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import copy
1010
import gzip
11-
import sys
1211
import warnings
1312

1413
import numpy as np

lib/matplotlib/backends/backend_gtk3agg.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import sys
2-
31
import numpy as np
42

53
from . import backend_agg, backend_cairo, backend_gtk3
6-
from ._gtk3_compat import gi
74
from .backend_cairo import cairo
85
from .backend_gtk3 import Gtk, _BackendGTK3
96
from matplotlib import transforms

lib/matplotlib/backends/backend_gtk3cairo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from . import backend_cairo, backend_gtk3
2-
from ._gtk3_compat import gi
32
from .backend_gtk3 import Gtk, _BackendGTK3
43
from matplotlib.backend_bases import cursors
54

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from base64 import b64encode
77
import io
88
import json
9-
import os
109
import pathlib
1110
import uuid
1211

@@ -18,7 +17,7 @@
1817
# Jupyter/IPython 3.x or earlier
1918
from IPython.kernel.comm import Comm
2019

21-
from matplotlib import rcParams, is_interactive
20+
from matplotlib import is_interactive
2221
from matplotlib._pylab_helpers import Gcf
2322
from matplotlib.backend_bases import (
2423
_Backend, FigureCanvasBase, NavigationToolbar2)

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
_Backend, FigureCanvasBase, FigureManagerBase, GraphicsContextBase,
2828
RendererBase)
2929
from matplotlib.backends.backend_mixed import MixedModeRenderer
30-
from matplotlib.cbook import (get_realpath_and_stat,
31-
is_writable_file_like, maxdict)
30+
from matplotlib.cbook import get_realpath_and_stat, maxdict
3231
from matplotlib.figure import Figure
3332
from matplotlib.font_manager import findfont, is_opentype_cff_font, get_font
3433
from matplotlib.afm import AFM
@@ -1999,7 +1998,6 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
19991998

20001999
if rcParams['pdf.use14corefonts']:
20012000
font = self._get_font_afm(prop)
2002-
l, b, w, h = font.get_str_bbox(s)
20032001
fonttype = 1
20042002
else:
20052003
font = self._get_font_ttf(prop)

lib/matplotlib/backends/backend_ps.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import re
1313
import shutil
1414
import subprocess
15-
import sys
1615
from tempfile import TemporaryDirectory
1716
import time
1817

lib/matplotlib/backends/backend_webagg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import errno
1616
from io import BytesIO
1717
import json
18-
import os
1918
from pathlib import Path
2019
import random
2120
import sys

lib/matplotlib/collections.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
import math
1313
from numbers import Number
14-
import warnings
15-
1614
import numpy as np
1715

1816
import matplotlib as mpl

lib/matplotlib/contour.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,10 +1218,6 @@ def _contour_level_args(self, z, args):
12181218
"""
12191219
Determine the contour levels and store in self.levels.
12201220
"""
1221-
if self.filled:
1222-
fn = 'contourf'
1223-
else:
1224-
fn = 'contour'
12251221
self._auto = False
12261222
if self.levels is None:
12271223
if len(args) == 0:

lib/matplotlib/dviread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import numpy as np
3131

32-
from matplotlib import cbook, rcParams
32+
from matplotlib import rcParams
3333

3434
_log = logging.getLogger(__name__)
3535

lib/matplotlib/figure.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,6 @@ def __setstate__(self, state):
19271927
restore_to_pylab = state.pop('_restore_to_pylab', False)
19281928

19291929
if version != _mpl_version:
1930-
import warnings
19311930
warnings.warn("This figure was saved with matplotlib version %s "
19321931
"and is unlikely to function correctly." %
19331932
(version, ))
@@ -2489,7 +2488,6 @@ def align_ylabels(self, axs=None):
24892488
_log.debug(' Working on: %s', ax.get_ylabel())
24902489
ss = ax.get_subplotspec()
24912490
nrows, ncols, row0, row1, col0, col1 = ss.get_rows_columns()
2492-
same = [ax]
24932491
labpo = ax.yaxis.get_label_position() # left or right
24942492
# loop through other axes, and search for label positions
24952493
# that are same as this one, and that share the appropriate

lib/matplotlib/legend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from matplotlib import docstring
3131
from matplotlib.artist import Artist, allow_rasterization
3232
from matplotlib.cbook import silent_list, is_hashable, warn_deprecated
33-
import matplotlib.colors as colors
3433
from matplotlib.font_manager import FontProperties
3534
from matplotlib.lines import Line2D
3635
from matplotlib.patches import Patch, Rectangle, Shadow, FancyBboxPatch

lib/matplotlib/lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
STEP_LOOKUP_MAP)
1717
from .markers import MarkerStyle
1818
from .path import Path
19-
from .transforms import Bbox, TransformedPath, IdentityTransform
19+
from .transforms import Bbox, TransformedPath
2020

2121
# Imported here for backward compatibility, even though they don't
2222
# really belong.

lib/matplotlib/mlab.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,6 @@ def derivs(x,t):
17181718
yout = np.zeros((len(t), Ny), float)
17191719

17201720
yout[0] = y0
1721-
i = 0
17221721

17231722
for i in np.arange(len(t)-1):
17241723

lib/matplotlib/patches.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,6 @@ def _bind_draw_path_function(self, renderer):
511511
gc.set_url(self._url)
512512
gc.set_snap(self.get_snap())
513513

514-
rgbFace = self._facecolor
515-
if rgbFace[3] == 0:
516-
rgbFace = None # (some?) renderers expect this as no-fill signal
517-
518514
gc.set_alpha(self._alpha)
519515

520516
if self._hatch:

lib/matplotlib/projections/polar.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
from matplotlib.axes import Axes
77
import matplotlib.axis as maxis
8-
from matplotlib import cbook
9-
from matplotlib import docstring
108
import matplotlib.markers as mmarkers
119
import matplotlib.patches as mpatches
1210
import matplotlib.path as mpath

lib/matplotlib/rcsetup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import operator
1919
import os
2020
import re
21-
import sys
2221

2322
from matplotlib import cbook
2423
from matplotlib.cbook import ls_mapper

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@
151151
from docutils.parsers.rst import directives
152152
from docutils.parsers.rst.directives.images import Image
153153
align = Image.align
154-
import sphinx
155-
156154
import jinja2 # Sphinx dependency.
157155

158156
import matplotlib

lib/matplotlib/streamplot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ def _gen_starting_points(shape):
642642
xlast = nx - 1
643643
ylast = ny - 1
644644
x, y = 0, 0
645-
i = 0
646645
direction = 'right'
647646
for i in range(nx * ny):
648647

lib/matplotlib/transforms.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
from matplotlib._path import (
4444
affine_transform, count_bboxes_overlapping_bbox, update_path_extents)
45-
from . import cbook
4645
from .path import Path
4746

4847
DEBUG = False
@@ -2355,8 +2354,6 @@ def __init__(self, a, b, **kwargs):
23552354
self._b = b
23562355
self.set_children(a, b)
23572356

2358-
is_affine = property(lambda self: self._a.is_affine and self._b.is_affine)
2359-
23602357
def frozen(self):
23612358
self._invalid = 0
23622359
frozen = composite_transform_factory(self._a.frozen(), self._b.frozen())

lib/mpl_toolkits/axes_grid1/axes_divider.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
object that can be used to set the axes_locator of the axes.
1111
"""
1212

13-
import functools
14-
1513
import matplotlib.transforms as mtransforms
1614
from matplotlib import cbook
1715
from matplotlib.axes import SubplotBase

lib/mpl_toolkits/axes_grid1/parasite_axes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import functools
22

3-
from matplotlib import (
4-
artist as martist, collections as mcoll, transforms as mtransforms,
5-
rcParams)
3+
from matplotlib import artist as martist, transforms as mtransforms
64
from matplotlib.axes import subplot_class_factory
75
from matplotlib.transforms import Bbox
86
from .mpl_axes import Axes

lib/mpl_toolkits/axisartist/floating_axes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
from matplotlib.transforms import Affine2D, IdentityTransform
1313
from . import grid_helper_curvelinear
14-
from .axislines import AxisArtistHelper, GridHelperBase
1514
from .axis_artist import AxisArtist
16-
from .grid_finder import GridFinder
1715

1816

1917
class FloatingAxisArtistHelper(grid_helper_curvelinear.FloatingAxisArtistHelper):

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
77
# to ensure that we error out properly for people with outdated setuptools
88
# and/or pip.
9-
from string import Template
109
import sys
1110
from setuptools import setup
1211
from setuptools.command.test import test as TestCommand

setupext.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import os
1111
import pathlib
1212
import platform
13-
import re
1413
import shutil
1514
import subprocess
1615
import sys

tools/boilerplate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# analysis tools to parse.
1515

1616
import inspect
17-
from inspect import Signature, Parameter
17+
from inspect import Parameter
1818
from pathlib import Path
1919
import textwrap
2020

tools/github_stats.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# Imports
1010
#-----------------------------------------------------------------------------
1111

12-
import codecs
1312
import sys
1413

1514
from argparse import ArgumentParser

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
#import matplotlib
5353
#matplotlib.use('Qt5Agg')
5454

55-
import warnings
56-
5755
import matplotlib.pyplot as plt
5856
import numpy as np
5957
import matplotlib.colors as mcolors

0 commit comments

Comments
 (0)