Skip to content

Commit f797268

Browse files
oscargusQuLogic
authored andcommitted
Change first argument to add_axes from list to tuple
1 parent a7b4a8b commit f797268

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+93
-93
lines changed

doc/project/history.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Matplotlib logo (2008 - 2015).
157157

158158

159159
def add_math_background():
160-
ax = fig.add_axes([0., 0., 1., 1.])
160+
ax = fig.add_axes((0., 0., 1., 1.))
161161

162162
text = []
163163
text.append(
@@ -187,7 +187,7 @@ Matplotlib logo (2008 - 2015).
187187

188188

189189
def add_polar_bar():
190-
ax = fig.add_axes([0.025, 0.075, 0.2, 0.85], projection='polar')
190+
ax = fig.add_axes((0.025, 0.075, 0.2, 0.85), projection='polar')
191191

192192
ax.patch.set_alpha(axalpha)
193193
ax.set_axisbelow(True)

doc/users/prev_whats_new/whats_new_3.5.0.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ of the text inside the Axes of the `.TextBox` widget.
274274

275275
fig = plt.figure(figsize=(4, 3))
276276
for i, alignment in enumerate(['left', 'center', 'right']):
277-
box_input = fig.add_axes([0.1, 0.7 - i*0.3, 0.8, 0.2])
278-
text_box = TextBox(ax=box_input, initial=f'{alignment} alignment',
279-
label='', textalignment=alignment)
277+
box_input = fig.add_axes((0.1, 0.7 - i*0.3, 0.8, 0.2))
278+
text_box = TextBox(ax=box_input, initial=f'{alignment} alignment',
279+
label='', textalignment=alignment)
280280

281281
Simplifying the font setting for usetex mode
282282
--------------------------------------------

galleries/examples/animation/rain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# Create new Figure and an Axes which fills it.
2424
fig = plt.figure(figsize=(7, 7))
25-
ax = fig.add_axes([0, 0, 1, 1], frameon=False)
25+
ax = fig.add_axes((0, 0, 1, 1), frameon=False)
2626
ax.set_xlim(0, 1), ax.set_xticks([])
2727
ax.set_ylim(0, 1), ax.set_yticks([])
2828

galleries/examples/axes_grid1/make_room_for_ylabel_using_axesgrid.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from mpl_toolkits.axes_grid1.axes_divider import make_axes_area_auto_adjustable
1111

1212
fig = plt.figure()
13-
ax = fig.add_axes([0, 0, 1, 1])
13+
ax = fig.add_axes((0, 0, 1, 1))
1414

1515
ax.set_yticks([0.5], labels=["very long label"])
1616

@@ -19,8 +19,8 @@
1919
# %%
2020

2121
fig = plt.figure()
22-
ax1 = fig.add_axes([0, 0, 1, 0.5])
23-
ax2 = fig.add_axes([0, 0.5, 1, 0.5])
22+
ax1 = fig.add_axes((0, 0, 1, 0.5))
23+
ax2 = fig.add_axes((0, 0.5, 1, 0.5))
2424

2525
ax1.set_yticks([0.5], labels=["very long label"])
2626
ax1.set_ylabel("Y label")
@@ -33,7 +33,7 @@
3333
# %%
3434

3535
fig = plt.figure()
36-
ax1 = fig.add_axes([0, 0, 1, 1])
36+
ax1 = fig.add_axes((0, 0, 1, 1))
3737
divider = make_axes_locatable(ax1)
3838

3939
ax2 = divider.append_axes("right", "100%", pad=0.3, sharey=ax1)

galleries/examples/axisartist/demo_parasite_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
fig = plt.figure()
2626

27-
host = fig.add_axes([0.15, 0.1, 0.65, 0.8], axes_class=HostAxes)
27+
host = fig.add_axes((0.15, 0.1, 0.65, 0.8), axes_class=HostAxes)
2828
par1 = host.get_aux_axes(viewlim_mode=None, sharex=host)
2929
par2 = host.get_aux_axes(viewlim_mode=None, sharex=host)
3030

galleries/examples/images_contours_and_fields/barcode_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
dpi = 100
3131

3232
fig = plt.figure(figsize=(len(code) * pixel_per_bar / dpi, 2), dpi=dpi)
33-
ax = fig.add_axes([0, 0, 1, 1]) # span the whole figure
33+
ax = fig.add_axes((0, 0, 1, 1)) # span the whole figure
3434
ax.set_axis_off()
3535
ax.imshow(code.reshape(1, -1), cmap='binary', aspect='auto',
3636
interpolation='nearest')

galleries/examples/images_contours_and_fields/image_antialiasing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
# may serve a 100x100 version of the image, which will be downsampled.)
246246

247247
fig = plt.figure(figsize=(2, 2))
248-
ax = fig.add_axes([0, 0, 1, 1])
248+
ax = fig.add_axes((0, 0, 1, 1))
249249
ax.imshow(aa[:400, :400], cmap='RdBu_r', interpolation='nearest')
250250
plt.show()
251251
# %%

galleries/examples/images_contours_and_fields/image_exact_placement.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ def annotate_rect(ax):
134134
fig = plt.figure(figsize=(fig_width / dpi, fig_height / dpi), facecolor='aliceblue')
135135

136136
# the position posA must be normalized by the figure width and height:
137-
ax = fig.add_axes([posA[0] / fig_width, posA[1] / fig_height,
138-
posA[2] / fig_width, posA[3] / fig_height])
137+
ax = fig.add_axes((posA[0] / fig_width, posA[1] / fig_height,
138+
posA[2] / fig_width, posA[3] / fig_height))
139139
ax.imshow(A, vmin=-1, vmax=1)
140140
annotate_rect(ax)
141141

142-
ax = fig.add_axes([posB[0] / fig_width, posB[1] / fig_height,
143-
posB[2] / fig_width, posB[3] / fig_height])
142+
ax = fig.add_axes((posB[0] / fig_width, posB[1] / fig_height,
143+
posB[2] / fig_width, posB[3] / fig_height))
144144
ax.imshow(B, vmin=-1, vmax=1)
145145
plt.show()
146146
# %%

galleries/examples/misc/svg_filter_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import matplotlib.transforms as mtransforms
1818

1919
fig1 = plt.figure()
20-
ax = fig1.add_axes([0.1, 0.1, 0.8, 0.8])
20+
ax = fig1.add_axes((0.1, 0.1, 0.8, 0.8))
2121

2222
# draw lines
2323
l1, = ax.plot([0.1, 0.5, 0.9], [0.1, 0.9, 0.5], "bo-",

galleries/examples/misc/svg_filter_pie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# make a square figure and Axes
2121
fig = plt.figure(figsize=(6, 6))
22-
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
22+
ax = fig.add_axes((0.1, 0.1, 0.8, 0.8))
2323

2424
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
2525
fracs = [15, 30, 45, 10]

0 commit comments

Comments
 (0)