Skip to content

Commit 9a077e8

Browse files
committed
Fix imports after rebase, plus some reordering.
1 parent 4f560f7 commit 9a077e8

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

lib/matplotlib/axes/_axes.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@
1616
import matplotlib
1717
from matplotlib import _preprocess_data
1818

19-
from matplotlib._backports import numpy as _backports_np
2019
import matplotlib.cbook as cbook
21-
from matplotlib.cbook import (
22-
mplDeprecation, STEP_LOOKUP_MAP, iterable, safe_first_element)
2320
import matplotlib.collections as mcoll
2421
import matplotlib.colors as mcolors
2522
import matplotlib.contour as mcontour
2623
import matplotlib.category as _ # <-registers a category unit converter
2724
import matplotlib.dates as _ # <-registers a date unit converter
28-
from matplotlib import docstring
25+
import matplotlib.docstring as docstring
2926
import matplotlib.image as mimage
3027
import matplotlib.legend as mlegend
3128
import matplotlib.lines as mlines
@@ -41,9 +38,10 @@
4138
import matplotlib.ticker as mticker
4239
import matplotlib.transforms as mtransforms
4340
import matplotlib.tri as mtri
41+
from matplotlib.cbook import (
42+
_backports, mplDeprecation, STEP_LOOKUP_MAP, iterable, safe_first_element)
4443
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
45-
from matplotlib.axes._base import _AxesBase
46-
from matplotlib.axes._base import _process_plot_format
44+
from matplotlib.axes._base import _AxesBase, _process_plot_format
4745

4846

4947
rcParams = matplotlib.rcParams
@@ -2138,7 +2136,7 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
21382136
self.add_container(bar_container)
21392137

21402138
if tick_labels is not None:
2141-
tick_labels = _backports_np.broadcast_to(tick_labels, len(patches))
2139+
tick_labels = _backports.broadcast_to(tick_labels, len(patches))
21422140
tick_label_axis.set_ticks(tick_label_position)
21432141
tick_label_axis.set_ticklabels(tick_labels)
21442142

lib/mpl_toolkits/mplot3d/art3d.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def line_2d_to_3d(line, zs=0, zdir='z'):
149149
def path_to_3d_segment(path, zs=0, zdir='z'):
150150
'''Convert a path to a 3D segment.'''
151151

152-
zs = _backports_np.broadcast_to(zs, len(path))
152+
zs = _backports.broadcast_to(zs, len(path))
153153
pathsegs = path.iter_segments(simplify=False, curves=False)
154154
seg = [(x, y, z) for (((x, y), code), z) in zip(pathsegs, zs)]
155155
seg3d = [juggle_axes(x, y, z, zdir) for (x, y, z) in seg]
@@ -161,7 +161,7 @@ def paths_to_3d_segments(paths, zs=0, zdir='z'):
161161
Convert paths from a collection object to 3D segments.
162162
'''
163163

164-
zs = _backports_np.broadcast_to(zs, len(paths))
164+
zs = _backports.broadcast_to(zs, len(paths))
165165
segs = [path_to_3d_segment(path, pathz, zdir)
166166
for path, pathz in zip(paths, zs)]
167167
return segs
@@ -170,7 +170,7 @@ def paths_to_3d_segments(paths, zs=0, zdir='z'):
170170
def path_to_3d_segment_with_codes(path, zs=0, zdir='z'):
171171
'''Convert a path to a 3D segment with path codes.'''
172172

173-
zs = _backports_np.broadcast_to(zs, len(path))
173+
zs = _backports.broadcast_to(zs, len(path))
174174
seg = []
175175
codes = []
176176
pathsegs = path.iter_segments(simplify=False, curves=False)
@@ -186,7 +186,7 @@ def paths_to_3d_segments_with_codes(paths, zs=0, zdir='z'):
186186
Convert paths from a collection object to 3D segments with path codes.
187187
'''
188188

189-
zs = _backports_np.broadcast_to(zs, len(paths))
189+
zs = _backports.broadcast_to(zs, len(paths))
190190
segments = []
191191
codes_list = []
192192
for path, pathz in zip(paths, zs):
@@ -260,7 +260,7 @@ def __init__(self, *args, **kwargs):
260260
self.set_3d_properties(zs, zdir)
261261

262262
def set_3d_properties(self, verts, zs=0, zdir='z'):
263-
zs = _backports_np.broadcast_to(zs, len(verts))
263+
zs = _backports.broadcast_to(zs, len(verts))
264264
self._segment3d = [juggle_axes(x, y, z, zdir)
265265
for ((x, y), z) in zip(verts, zs)]
266266
self._facecolor3d = Patch.get_facecolor(self)

lib/mpl_toolkits/mplot3d/axes3d.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020

2121
import numpy as np
2222

23-
from matplotlib import (
24-
axes as maxes, cbook, collections as mcoll, colors as mcolors, docstring,
25-
scale as mscale, transforms as mtransforms)
26-
from matplotlib._backports import numpy as _backports_np
23+
import matplotlib.axes as maxes
24+
import matplotlib.cbook as cbook
25+
import matplotlib.collections as mcoll
26+
import matplotlib.colors as mcolors
27+
import matplotlib.docstring as docstring
28+
import matplotlib.scale as mscale
29+
import matplotlib.transforms as mtransforms
2730
from matplotlib.axes import Axes, rcParams
31+
from matplotlib.cbook import _backports
2832
from matplotlib.colors import Normalize, LightSource
2933
from matplotlib.transforms import Bbox
3034
from matplotlib.tri.triangulation import Triangulation
@@ -1534,7 +1538,7 @@ def plot(self, xs, ys, *args, **kwargs):
15341538
zdir = kwargs.pop('zdir', 'z')
15351539

15361540
# Match length
1537-
zs = _backports_np.broadcast_to(zs, len(xs))
1541+
zs = _backports.broadcast_to(zs, len(xs))
15381542

15391543
lines = super(Axes3D, self).plot(xs, ys, *args, **kwargs)
15401544
for line in lines:
@@ -2338,7 +2342,7 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True,
23382342
patches = super(Axes3D, self).scatter(
23392343
xs, ys, s=s, c=c, *args, **kwargs)
23402344
is_2d = not cbook.iterable(zs)
2341-
zs = _backports_np.broadcast_to(zs, len(xs))
2345+
zs = _backports.broadcast_to(zs, len(xs))
23422346
art3d.patch_collection_2d_to_3d(patches, zs=zs, zdir=zdir,
23432347
depthshade=depthshade)
23442348

@@ -2377,7 +2381,7 @@ def bar(self, left, height, zs=0, zdir='z', *args, **kwargs):
23772381

23782382
patches = super(Axes3D, self).bar(left, height, *args, **kwargs)
23792383

2380-
zs = _backports_np.broadcast_to(zs, len(left))
2384+
zs = _backports.broadcast_to(zs, len(left))
23812385

23822386
verts = []
23832387
verts_zs = []

0 commit comments

Comments
 (0)