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

Skip to content

Commit a6c551c

Browse files
committed
Add some comments
1 parent 7e9d305 commit a6c551c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/matplotlib/axes/_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,15 +2118,16 @@ def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
21182118
"""Look for unit *kwargs* and update the axis instances as necessary"""
21192119

21202120
def _process_single_axis(data, axis, unit_name, kwargs):
2121+
# Return if there's no axis set
21212122
if axis is None:
2122-
return
2123+
return kwargs
21232124

21242125
if data is not None:
21252126
# We only need to update if there is nothing set yet.
21262127
if not axis.have_units():
21272128
axis.update_units(data)
21282129

2129-
# Process kwargs 2nd since these will override default units
2130+
# Check for units in the kwargs, and if present update axis
21302131
if kwargs is not None:
21312132
units = kwargs.pop(unit_name, axis.units)
21322133
if self.name == 'polar':

0 commit comments

Comments
 (0)