@@ -553,60 +553,6 @@ def add_axes(self, *args, **kwargs):
553
553
554
554
Call signatures::
555
555
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
- Handle the args / kwargs to add_axes / add_subplot / gca , returning ::
565
-
566
- (axes_proj_class , proj_class_kwargs , proj_stack_key )
567
-
568
- which can be used for new axes initialization / 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
- Add an axes to the figure .
605
-
606
- Call signatures ::
607
-
608
- == == == =
609
- >> >> >> > Rebase
610
556
add_axes(rect, projection=None, polar=False, **kwargs)
611
557
add_axes(ax)
612
558
@@ -1639,30 +1585,39 @@ def _gci(self):
1639
1585
return None
1640
1586
1641
1587
def _process_projection_requirements (
1642
- self, *args, polar=False, projection=None, **kwargs):
1588
+ self , * args , axes_class = None , polar = False , projection = None ,
1589
+ ** kwargs ):
1643
1590
"""
1644
1591
Handle the args/kwargs to add_axes/add_subplot/gca, returning::
1645
1592
1646
1593
(axes_proj_class, proj_class_kwargs, proj_stack_key)
1647
1594
1648
1595
which can be used for new axes initialization/identification.
1649
1596
"""
1650
- if polar :
1651
- if projection is not None and projection != 'polar' :
1597
+ if axes_class is not None :
1598
+ if polar or projection is not None :
1652
1599
raise ValueError (
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
1663
1602
else :
1664
- raise TypeError('projection must be a string, None or implement a '
1665
- '_as_mpl_axes method. Got %r' % projection)
1603
+
1604
+ if polar :
1605
+ if projection is not None and projection != 'polar' :
1606
+ raise ValueError (
1607
+ "polar=True, yet projection=%r. "
1608
+ "Only one of these arguments should be supplied." %
1609
+ projection )
1610
+ projection = 'polar'
1611
+
1612
+ if isinstance (projection , str ) or projection is None :
1613
+ projection_class = projections .get_projection_class (projection )
1614
+ elif hasattr (projection , '_as_mpl_axes' ):
1615
+ projection_class , extra_kwargs = projection ._as_mpl_axes ()
1616
+ kwargs .update (** extra_kwargs )
1617
+ else :
1618
+ raise TypeError (
1619
+ f"projection must be a string, None or implement a "
1620
+ f"_as_mpl_axes method, not { projection !r} " )
1666
1621
1667
1622
# Make the key without projection kwargs, this is used as a unique
1668
1623
# lookup for axes instances
0 commit comments