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

Skip to content

Commit f7b88be

Browse files
authored
Merge pull request #13090 from anntzer/unused-imports
Cleanup unused non-public imports.
2 parents ad2c77c + a4e745c commit f7b88be

File tree

6 files changed

+18
-27
lines changed

6 files changed

+18
-27
lines changed

examples/misc/custom_projection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,7 @@ def _get_core_transform(self, resolution):
450450
return self.HammerTransform(resolution)
451451

452452

453-
# Now register the projection with matplotlib so the user can select
454-
# it.
453+
# Now register the projection with Matplotlib so the user can select it.
455454
register_projection(HammerAxes)
456455

457456

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
import numpy as np
1010
from numpy import ma
1111

12-
import matplotlib
13-
from matplotlib import _preprocess_data
14-
12+
from matplotlib import _preprocess_data, rcParams
1513
import matplotlib.cbook as cbook
1614
import matplotlib.collections as mcoll
1715
import matplotlib.colors as mcolors
@@ -39,8 +37,6 @@
3937

4038
_log = logging.getLogger(__name__)
4139

42-
rcParams = matplotlib.rcParams
43-
4440

4541
def _make_inset_locator(bounds, trans, parent):
4642
"""

lib/matplotlib/backends/backend_cairo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
This backend depends on cairocffi or pycairo.
77
"""
88

9-
import copy
109
import gzip
1110

1211
import numpy as np

lib/matplotlib/backends/backend_pdf.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
from functools import total_ordering
1010
from io import BytesIO
1111
import logging
12-
from math import ceil, cos, floor, pi, sin
12+
import math
1313
import os
1414
import re
1515
import struct
16-
import sys
1716
import time
1817
import types
1918
import warnings
@@ -890,9 +889,9 @@ def cvt(length, upe=font.units_per_EM, nearest=True):
890889
# Perhaps best to round away from zero for bounding
891890
# boxes and the like
892891
if value < 0:
893-
return floor(value)
892+
return math.floor(value)
894893
else:
895-
return ceil(value)
894+
return math.ceil(value)
896895

897896
def embedTTFType3(font, characters, descriptor):
898897
"""The Type 3-specific part of embedding a Truetype font"""
@@ -1818,9 +1817,9 @@ def _setup_textpos(self, x, y, angle, oldx=0, oldy=0, oldangle=0):
18181817
if angle == oldangle == 0:
18191818
self.file.output(x - oldx, y - oldy, Op.textpos)
18201819
else:
1821-
angle = angle / 180.0 * pi
1822-
self.file.output(cos(angle), sin(angle),
1823-
-sin(angle), cos(angle),
1820+
angle = math.radians(angle)
1821+
self.file.output(math.cos(angle), math.sin(angle),
1822+
-math.sin(angle), math.cos(angle),
18241823
x, y, Op.textmatrix)
18251824
self.file.output(0, 0, Op.textpos)
18261825

@@ -1836,10 +1835,11 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
18361835
global_fonttype = rcParams['pdf.fonttype']
18371836

18381837
# Set up a global transformation matrix for the whole math expression
1839-
a = angle / 180.0 * pi
1838+
a = math.radians(angle)
18401839
self.file.output(Op.gsave)
1841-
self.file.output(cos(a), sin(a), -sin(a), cos(a), x, y,
1842-
Op.concat_matrix)
1840+
self.file.output(math.cos(a), math.sin(a),
1841+
-math.sin(a), math.cos(a),
1842+
x, y, Op.concat_matrix)
18431843

18441844
self.check_gc(gc, gc._rgb)
18451845
self.file.output(Op.begin_text)
@@ -2058,9 +2058,10 @@ def draw_text_woven(chunks):
20582058
# Do the rotation and global translation as a single matrix
20592059
# concatenation up front
20602060
self.file.output(Op.gsave)
2061-
a = angle / 180.0 * pi
2062-
self.file.output(cos(a), sin(a), -sin(a), cos(a), x, y,
2063-
Op.concat_matrix)
2061+
a = math.radians(angle)
2062+
self.file.output(math.cos(a), math.sin(a),
2063+
-math.sin(a), math.cos(a),
2064+
x, y, Op.concat_matrix)
20642065

20652066
# Output all the 1-byte characters in a BT/ET group, then
20662067
# output all the 2-byte characters.

lib/matplotlib/projections/polar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import types
33

44
import numpy as np
5-
import warnings
65

76
from matplotlib.axes import Axes
87
import matplotlib.axis as maxis

lib/matplotlib/tight_layout.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
for some cases (for example, left or right margin is affected by xlabel).
1010
"""
1111

12-
import matplotlib
13-
from matplotlib import cbook
14-
from matplotlib.transforms import TransformedBbox, Bbox
15-
12+
from matplotlib import cbook, rcParams
1613
from matplotlib.font_manager import FontProperties
17-
rcParams = matplotlib.rcParams
14+
from matplotlib.transforms import TransformedBbox, Bbox
1815

1916

2017
def _get_left(tight_bbox, axes_bbox):

0 commit comments

Comments
 (0)