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

Skip to content

Cleanup unused non-public imports. #13090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/misc/custom_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,7 @@ def _get_core_transform(self, resolution):
return self.HammerTransform(resolution)


# Now register the projection with matplotlib so the user can select
# it.
# Now register the projection with Matplotlib so the user can select it.
register_projection(HammerAxes)


Expand Down
6 changes: 1 addition & 5 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
import numpy as np
from numpy import ma

import matplotlib
from matplotlib import _preprocess_data

from matplotlib import _preprocess_data, rcParams
import matplotlib.cbook as cbook
import matplotlib.collections as mcoll
import matplotlib.colors as mcolors
Expand Down Expand Up @@ -39,8 +37,6 @@

_log = logging.getLogger(__name__)

rcParams = matplotlib.rcParams


def _make_inset_locator(bounds, trans, parent):
"""
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/backends/backend_cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
This backend depends on cairocffi or pycairo.
"""

import copy
import gzip

import numpy as np
Expand Down
27 changes: 14 additions & 13 deletions lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
from functools import total_ordering
from io import BytesIO
import logging
from math import ceil, cos, floor, pi, sin
import math
import os
import re
import struct
import sys
import time
import types
import warnings
Expand Down Expand Up @@ -890,9 +889,9 @@ def cvt(length, upe=font.units_per_EM, nearest=True):
# Perhaps best to round away from zero for bounding
# boxes and the like
if value < 0:
return floor(value)
return math.floor(value)
else:
return ceil(value)
return math.ceil(value)

def embedTTFType3(font, characters, descriptor):
"""The Type 3-specific part of embedding a Truetype font"""
Expand Down Expand Up @@ -1818,9 +1817,9 @@ def _setup_textpos(self, x, y, angle, oldx=0, oldy=0, oldangle=0):
if angle == oldangle == 0:
self.file.output(x - oldx, y - oldy, Op.textpos)
else:
angle = angle / 180.0 * pi
self.file.output(cos(angle), sin(angle),
-sin(angle), cos(angle),
angle = math.radians(angle)
self.file.output(math.cos(angle), math.sin(angle),
-math.sin(angle), math.cos(angle),
x, y, Op.textmatrix)
self.file.output(0, 0, Op.textpos)

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

# Set up a global transformation matrix for the whole math expression
a = angle / 180.0 * pi
a = math.radians(angle)
self.file.output(Op.gsave)
self.file.output(cos(a), sin(a), -sin(a), cos(a), x, y,
Op.concat_matrix)
self.file.output(math.cos(a), math.sin(a),
-math.sin(a), math.cos(a),
x, y, Op.concat_matrix)

self.check_gc(gc, gc._rgb)
self.file.output(Op.begin_text)
Expand Down Expand Up @@ -2058,9 +2058,10 @@ def draw_text_woven(chunks):
# Do the rotation and global translation as a single matrix
# concatenation up front
self.file.output(Op.gsave)
a = angle / 180.0 * pi
self.file.output(cos(a), sin(a), -sin(a), cos(a), x, y,
Op.concat_matrix)
a = math.radians(angle)
self.file.output(math.cos(a), math.sin(a),
-math.sin(a), math.cos(a),
x, y, Op.concat_matrix)

# Output all the 1-byte characters in a BT/ET group, then
# output all the 2-byte characters.
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/projections/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import types

import numpy as np
import warnings

from matplotlib.axes import Axes
import matplotlib.axis as maxis
Expand Down
7 changes: 2 additions & 5 deletions lib/matplotlib/tight_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
for some cases (for example, left or right margin is affected by xlabel).
"""

import matplotlib
from matplotlib import cbook
from matplotlib.transforms import TransformedBbox, Bbox

from matplotlib import cbook, rcParams
from matplotlib.font_manager import FontProperties
rcParams = matplotlib.rcParams
from matplotlib.transforms import TransformedBbox, Bbox


def _get_left(tight_bbox, axes_bbox):
Expand Down