Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a077e8

Browse files
committed
Fix imports after rebase, plus some reordering.
1 parent4f560f7 commit9a077e8

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
@@ -16,16 +16,13 @@
1616
importmatplotlib
1717
frommatplotlibimport_preprocess_data
1818

19-
frommatplotlib._backportsimportnumpyas_backports_np
2019
importmatplotlib.cbookascbook
21-
frommatplotlib.cbookimport (
22-
mplDeprecation,STEP_LOOKUP_MAP,iterable,safe_first_element)
2320
importmatplotlib.collectionsasmcoll
2421
importmatplotlib.colorsasmcolors
2522
importmatplotlib.contourasmcontour
2623
importmatplotlib.categoryas_# <-registers a category unit converter
2724
importmatplotlib.datesas_# <-registers a date unit converter
28-
frommatplotlibimportdocstring
25+
importmatplotlib.docstringasdocstring
2926
importmatplotlib.imageasmimage
3027
importmatplotlib.legendasmlegend
3128
importmatplotlib.linesasmlines
@@ -41,9 +38,10 @@
4138
importmatplotlib.tickerasmticker
4239
importmatplotlib.transformsasmtransforms
4340
importmatplotlib.triasmtri
41+
frommatplotlib.cbookimport (
42+
_backports,mplDeprecation,STEP_LOOKUP_MAP,iterable,safe_first_element)
4443
frommatplotlib.containerimportBarContainer,ErrorbarContainer,StemContainer
45-
frommatplotlib.axes._baseimport_AxesBase
46-
frommatplotlib.axes._baseimport_process_plot_format
44+
frommatplotlib.axes._baseimport_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
iftick_labelsisnotNone:
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‎

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
defpath_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)inzip(pathsegs,zs)]
155155
seg3d= [juggle_axes(x,y,z,zdir)for (x,y,z)inseg]
@@ -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
forpath,pathzinzip(paths,zs)]
167167
returnsegs
@@ -170,7 +170,7 @@ def paths_to_3d_segments(paths, zs=0, zdir='z'):
170170
defpath_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
forpath,pathzinzip(paths,zs):
@@ -260,7 +260,7 @@ def __init__(self, *args, **kwargs):
260260
self.set_3d_properties(zs,zdir)
261261

262262
defset_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)inzip(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
importnumpyasnp
2222

23-
frommatplotlibimport (
24-
axesasmaxes,cbook,collectionsasmcoll,colorsasmcolors,docstring,
25-
scaleasmscale,transformsasmtransforms)
26-
frommatplotlib._backportsimportnumpyas_backports_np
23+
importmatplotlib.axesasmaxes
24+
importmatplotlib.cbookascbook
25+
importmatplotlib.collectionsasmcoll
26+
importmatplotlib.colorsasmcolors
27+
importmatplotlib.docstringasdocstring
28+
importmatplotlib.scaleasmscale
29+
importmatplotlib.transformsasmtransforms
2730
frommatplotlib.axesimportAxes,rcParams
31+
frommatplotlib.cbookimport_backports
2832
frommatplotlib.colorsimportNormalize,LightSource
2933
frommatplotlib.transformsimportBbox
3034
frommatplotlib.tri.triangulationimportTriangulation
@@ -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
forlineinlines:
@@ -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=notcbook.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)

[8]ページ先頭

©2009-2025 Movatter.jp