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

Skip to content

Commit c0c3b03

Browse files
authored
Merge pull request #19502 from anntzer/pp
Prefer projection="polar" over polar=True.
2 parents 14ecfcc + b60dd14 commit c0c3b03

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

examples/pie_and_polar_charts/nested_pie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# a circle. The cumulative sum of the values are used as the edges
5353
# of the bars.
5454

55-
fig, ax = plt.subplots(subplot_kw=dict(polar=True))
55+
fig, ax = plt.subplots(subplot_kw=dict(projection="polar"))
5656

5757
size = 0.3
5858
vals = np.array([[60., 32.], [37., 40.], [29., 10.]])

examples/pie_and_polar_charts/polar_scatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# rotate the plot.
3434

3535
fig = plt.figure()
36-
ax = fig.add_subplot(polar=True)
36+
ax = fig.add_subplot(projection='polar')
3737
c = ax.scatter(theta, r, c=colors, s=area, cmap='hsv', alpha=0.75)
3838

3939
ax.set_rorigin(-2.5)
@@ -47,7 +47,7 @@
4747
# theta start and end limits, producing a sector instead of a full circle.
4848

4949
fig = plt.figure()
50-
ax = fig.add_subplot(polar=True)
50+
ax = fig.add_subplot(projection='polar')
5151
c = ax.scatter(theta, r, c=colors, s=area, cmap='hsv', alpha=0.75)
5252

5353
ax.set_thetamin(45)

examples/pyplots/annotation_polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import matplotlib.pyplot as plt
1313

1414
fig = plt.figure()
15-
ax = fig.add_subplot(polar=True)
15+
ax = fig.add_subplot(projection='polar')
1616
r = np.arange(0, 1, 0.001)
1717
theta = 2 * 2*np.pi * r
1818
line, = ax.plot(theta, r, color='#ee8d18', lw=3)

lib/matplotlib/figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
813813
ax2.scatter(x, y)
814814
815815
# Create four polar Axes and access them through the returned array
816-
axes = fig.subplots(2, 2, subplot_kw=dict(polar=True))
816+
axes = fig.subplots(2, 2, subplot_kw=dict(projection='polar'))
817817
axes[0, 0].plot(x, y)
818818
axes[1, 1].scatter(x, y)
819819

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
13601360
ax2.scatter(x, y)
13611361
13621362
# Create four polar axes and access them through the returned array
1363-
fig, axs = plt.subplots(2, 2, subplot_kw=dict(polar=True))
1363+
fig, axs = plt.subplots(2, 2, subplot_kw=dict(projection="polar"))
13641364
axs[0, 0].plot(x, y)
13651365
axs[1, 1].scatter(x, y)
13661366
@@ -2426,7 +2426,7 @@ def polar(*args, **kwargs):
24262426
else:
24272427
_api.warn_external('Trying to create polar plot on an Axes '
24282428
'that does not have a polar projection.')
2429-
ax = axes(polar=True)
2429+
ax = axes(projection="polar")
24302430
ret = ax.plot(*args, **kwargs)
24312431
return ret
24322432

0 commit comments

Comments
 (0)