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

Commit665b399

Browse files
committed
Add some comments
1 parent09fcae4 commit665b399

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎lib/matplotlib/units.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,19 @@ def _accepts_units(convert_x, convert_y):
6565
defdecorator(func):
6666
defwrapper(*args,**kwargs):
6767
axes=args[0]
68+
# Bind the incoming arguments to the function signature
6869
bound_args=inspect.signature(func).bind(*args,**kwargs)
70+
# Get the original arguments - these will be modified later
6971
arguments=bound_args.arguments
72+
# Check for data kwarg
7073
has_data= (('data'inarguments)and
7174
(arguments['data']isnotNone))
7275
ifhas_data:
7376
data=arguments['data']
7477

78+
# Loop through each argument to be converted, update the axis
79+
# unit info, convert argument, and replace in *arguments* with
80+
# converted values
7581
forarginconvert_x:
7682
ifhas_dataandarguments[arg]indata:
7783
data_arg=arguments[arg]
@@ -100,8 +106,10 @@ def wrapper(*args, **kwargs):
100106

101107
ifhas_data:
102108
arguments['data']=data
109+
# Update the arguments with converted values
103110
bound_args.arguments=arguments
104111

112+
# Give updated values to the original function
105113
args=bound_args.args
106114
kwargs=bound_args.kwargs
107115
returnfunc(*args,**kwargs)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp