pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/matplotlib/matplotlib/commit/7e5029e69de0622ba08fdf329f90ac28e7b302c0

rigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7a1ad343bd40328c.css" /> Change variable names to match coding style · matplotlib/matplotlib@7e5029e · GitHub
Skip to content

Commit 7e5029e

Browse files
committed
Change variable names to match coding style
1 parent 0f7b472 commit 7e5029e

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,34 @@ def convert_limits(lim, converter):
4141

4242
axis_map = axes._axis_map
4343
axis_limits = {
44-
axname: tuple(convert_limits(
45-
getattr(axes, f'get_{axname}lim')(), axis.converter
44+
name: tuple(convert_limits(
45+
getattr(axes, f'get_{name}lim')(), axis.converter
4646
))
47-
for axname, axis in axis_map.items()
47+
for name, axis in axis_map.items()
4848
}
4949
general = [
5050
('Title', axes.get_title()),
5151
sep,
5252
]
5353
axes_info = [
5454
(
55-
(None, f"<b>{axis.upper()}-Axis</b>"),
56-
('Min', axis_limits[axis][0]),
57-
('Max', axis_limits[axis][1]),
58-
('Label', getattr(axes, f"get_{axis}label")()),
59-
('Scale', [getattr(axes, f"get_{axis}scale")(),
55+
(None, f"<b>{name.upper()}-Axis</b>"),
56+
('Min', axis_limits[name][0]),
57+
('Max', axis_limits[name][1]),
58+
('Label', axis.get_label().get_text()),
59+
('Scale', [axis.get_scale(),
6060
'linear', 'log', 'symlog', 'logit']),
6161
sep,
6262
)
63-
for axis in axis_map.keys()
63+
for name, axis in axis_map.items()
6464
]
6565
general.extend(chain.from_iterable(axes_info))
6666
general.append(('(Re-)Generate automatic legend', False))
6767

6868
# Save the unit data
6969
axis_units = {
70-
axis: getattr(getattr(axes, f"{axis}axis"), "get_units")()
71-
for axis in axis_map.keys()
70+
name: axis.get_units()
71+
for name, axis in axis_map.items()
7272
}
7373

7474
# Get / Curves
@@ -174,8 +174,8 @@ def prepare_data(d, init):
174174
def apply_callback(data):
175175
"""A callback to apply changes."""
176176
orig_limits = {
177-
axis: getattr(axes, f"get_{axis}lim")()
178-
for axis in axis_map.keys()
177+
name: getattr(axes, f"get_{name}lim")()
178+
for name in axis_map.keys()
179179
}
180180

181181
general = data.pop(0)
@@ -188,19 +188,19 @@ def apply_callback(data):
188188
axes.set_title(title)
189189
generate_legend = general.pop()
190190

191-
for i, (axname, ax) in enumerate(axis_map.items()):
192-
axmin = general[4*i]
193-
axmax = general[4*i + 1]
194-
axlabel = general[4*i + 2]
195-
axscale = general[4*i + 3]
196-
if getattr(axes, f"get_{axname}scale")() != axscale:
197-
getattr(axes, f"set_{axname}scale")(axscale)
191+
for i, (name, axis) in enumerate(axis_map.items()):
192+
axis_min = general[4*i]
193+
axis_max = general[4*i + 1]
194+
axis_label = general[4*i + 2]
195+
axis_scale = general[4*i + 3]
196+
if getattr(axes, f"get_{name}scale")() != axis_scale:
197+
getattr(axes, f"set_{name}scale")(axis_scale)
198198

199-
getattr(axes, f"set_{axname}lim")(axmin, axmax)
200-
getattr(axes, f"set_{axname}label")(axlabel)
201-
setattr(ax, 'converter', ax.converter)
202-
getattr(ax, 'set_units')(axis_units[axname])
203-
ax._update_axisinfo()
199+
getattr(axes, f"set_{name}lim")(axis_min, axis_max)
200+
axis.set_label_text(axis_label)
201+
setattr(axis, 'converter', axis.converter)
202+
axis.set_units(axis_units[name])
203+
axis._update_axisinfo()
204204

205205
# Set / Curves
206206
for index, curve in enumerate(curves):
@@ -247,8 +247,8 @@ def apply_callback(data):
247247
# Redraw
248248
figure = axes.get_figure()
249249
figure.canvas.draw()
250-
for axis in axis_map.keys():
251-
if getattr(axes, f"get_{axis}lim")() != orig_limits[axis]:
250+
for name in axis_map.keys():
251+
if getattr(axes, f"get_{name}lim")() != orig_limits[name]:
252252
figure.canvas.toolbar.push_current()
253253
break
254254

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy