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

Skip to content

Commit 4ae08f2

Browse files
committed
Fix imports after rebase, plus some reordering.
1 parent 22cc5c1 commit 4ae08f2

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
import matplotlib
1616
from matplotlib import _preprocess_data
1717

18-
from matplotlib._backports import numpy as _backports_np
1918
import matplotlib.cbook as cbook
20-
from matplotlib.cbook import (
21-
mplDeprecation, STEP_LOOKUP_MAP, iterable, safe_first_element)
2219
import matplotlib.collections as mcoll
2320
import matplotlib.colors as mcolors
2421
import matplotlib.contour as mcontour
2522
import matplotlib.category as _ # <-registers a category unit converter
2623
import matplotlib.dates as _ # <-registers a date unit converter
27-
from matplotlib import docstring
24+
import matplotlib.docstring as docstring
2825
import matplotlib.image as mimage
2926
import matplotlib.legend as mlegend
3027
import matplotlib.lines as mlines
@@ -40,9 +37,10 @@
4037
import matplotlib.ticker as mticker
4138
import matplotlib.transforms as mtransforms
4239
import matplotlib.tri as mtri
40+
from matplotlib.cbook import (
41+
_backports, mplDeprecation, STEP_LOOKUP_MAP, iterable, safe_first_element)
4342
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
44-
from matplotlib.axes._base import _AxesBase
45-
from matplotlib.axes._base import _process_plot_format
43+
from matplotlib.axes._base import _AxesBase, _process_plot_format
4644

4745

4846
rcParams = matplotlib.rcParams
@@ -2095,7 +2093,7 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
20952093
self.add_container(bar_container)
20962094

20972095
if tick_labels is not None:
2098-
tick_labels = _backports_np.broadcast_to(tick_labels, len(patches))
2096+
tick_labels = _backports.broadcast_to(tick_labels, len(patches))
20992097
tick_label_axis.set_ticks(tick_label_position)
21002098
tick_label_axis.set_ticklabels(tick_labels)
21012099

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 5 additions & 5 deletions
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

Lines changed: 11 additions & 7 deletions
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)