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

Commit835175b

Browse files
committed
REBASE
1 parentd1fa5cc commit835175b

File tree

1 file changed

+24
-69
lines changed

1 file changed

+24
-69
lines changed

‎lib/matplotlib/figure.py

Lines changed: 24 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -553,60 +553,6 @@ def add_axes(self, *args, **kwargs):
553553
554554
Call signatures::
555555
556-
<<<<<<< HEAD
557-
key = fixlist(args), fixitems(kwargs.items())
558-
return key
559-
560-
def _process_projection_requirements(
561-
self, *args, axes_class=None, polar=False, projection=None,
562-
**kwargs):
563-
"""
564-
Handletheargs/kwargstoadd_axes/add_subplot/gca,returning::
565-
566-
(axes_proj_class,proj_class_kwargs,proj_stack_key)
567-
568-
whichcanbeusedfornewaxesinitialization/identification.
569-
"""
570-
if axes_class is not None:
571-
if polar or projection is not None:
572-
raise ValueError(
573-
"Cannot combine 'axes_class' and 'projection' or 'polar'")
574-
projection_class = axes_class
575-
else:
576-
577-
if polar:
578-
if projection is not None and projection != 'polar':
579-
raise ValueError(
580-
"polar=True, yet projection=%r. "
581-
"Only one of these arguments should be supplied." %
582-
projection)
583-
projection = 'polar'
584-
585-
if isinstance(projection, str) or projection is None:
586-
projection_class = projections.get_projection_class(projection)
587-
elif hasattr(projection, '_as_mpl_axes'):
588-
projection_class, extra_kwargs = projection._as_mpl_axes()
589-
kwargs.update(**extra_kwargs)
590-
else:
591-
raise TypeError(
592-
f"projection must be a string, None or implement a "
593-
f"_as_mpl_axes method, not {projection!r}")
594-
595-
# Make the key without projection kwargs, this is used as a unique
596-
# lookup for axes instances
597-
key = self._make_key(*args, **kwargs)
598-
599-
return projection_class, kwargs, key
600-
601-
@docstring.dedent_interpd
602-
def add_axes(self, *args, **kwargs):
603-
"""
604-
Addanaxestothefigure.
605-
606-
Callsignatures::
607-
608-
=======
609-
>>>>>>>Rebase
610556
add_axes(rect, projection=None, polar=False, **kwargs)
611557
add_axes(ax)
612558
@@ -1639,30 +1585,39 @@ def _gci(self):
16391585
returnNone
16401586

16411587
def_process_projection_requirements(
1642-
self, *args, polar=False, projection=None, **kwargs):
1588+
self,*args,axes_class=None,polar=False,projection=None,
1589+
**kwargs):
16431590
"""
16441591
Handle the args/kwargs to add_axes/add_subplot/gca, returning::
16451592
16461593
(axes_proj_class, proj_class_kwargs, proj_stack_key)
16471594
16481595
which can be used for new axes initialization/identification.
16491596
"""
1650-
ifpolar:
1651-
if projection is not None and projection != 'polar':
1597+
ifaxes_classisnotNone:
1598+
ifpolarorprojectionisnotNone:
16521599
raiseValueError(
1653-
"polar=True, yet projection=%r. "
1654-
"Only one of these arguments should be supplied." %
1655-
projection)
1656-
projection = 'polar'
1657-
1658-
if isinstance(projection, str) or projection is None:
1659-
projection_class = projections.get_projection_class(projection)
1660-
elif hasattr(projection, '_as_mpl_axes'):
1661-
projection_class, extra_kwargs = projection._as_mpl_axes()
1662-
kwargs.update(**extra_kwargs)
1600+
"Cannot combine 'axes_class' and 'projection' or 'polar'")
1601+
projection_class=axes_class
16631602
else:
1664-
raise TypeError('projection must be a string, None or implement a '
1665-
'_as_mpl_axes method. Got %r' % projection)
1603+
1604+
ifpolar:
1605+
ifprojectionisnotNoneandprojection!='polar':
1606+
raiseValueError(
1607+
"polar=True, yet projection=%r. "
1608+
"Only one of these arguments should be supplied."%
1609+
projection)
1610+
projection='polar'
1611+
1612+
ifisinstance(projection,str)orprojectionisNone:
1613+
projection_class=projections.get_projection_class(projection)
1614+
elifhasattr(projection,'_as_mpl_axes'):
1615+
projection_class,extra_kwargs=projection._as_mpl_axes()
1616+
kwargs.update(**extra_kwargs)
1617+
else:
1618+
raiseTypeError(
1619+
f"projection must be a string, None or implement a "
1620+
f"_as_mpl_axes method, not{projection!r}")
16661621

16671622
# Make the key without projection kwargs, this is used as a unique
16681623
# lookup for axes instances

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp