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

Appearance settings

Commit 7b4fb1f

Browse filesBrowse files
committed
DOC: Add what's new for polar axes.
1 parent 179037c commit 7b4fb1f
Copy full SHA for 7b4fb1f

File tree

Expand file treeCollapse file tree

3 files changed

+83
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+83
-0
lines changed

‎doc/users/whats_new.rst

Copy file name to clipboardExpand all lines: doc/users/whats_new.rst
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,34 @@ Added a :code:`pivot` kwarg to :func:`~mpl_toolkits.mplot3d.Axes3D.quiver`
6060
that controls the pivot point around which the quiver line rotates. This also
6161
determines the placement of the arrow head along the quiver line.
6262

63+
Enhancements to polar plot
64+
``````````````````````````
65+
66+
The polar axes transforms have been greatly re-factored to allow for more
67+
customization of view limits and tick labelling. Additional options for view
68+
limits allow for creating an annulus, a sector, or some combination of the two.
69+
70+
The :meth:`~matplotlib.axes.projections.polar.PolarAxes.set_rorigin` method may
71+
be used to provide an offset to the minimum plotting radius, producing an
72+
annulus.
73+
74+
The :meth:`~matplotlib.projections.polar.PolarAxes.set_theta_zero_location` now
75+
has an optional :code:`offset` argument. This argument may be used to further
76+
specify the zero location based on the given anchor point.
77+
78+
.. plot:: mpl_examples/pie_and_polar_charts/polar_offset_demo.py
79+
80+
The :meth:`~matplotlib.axes.projections.polar.PolarAxes.set_thetamin` and
81+
:meth:`~matplotlib.axes.projections.polar.PolarAxes.set_thetamax` methods may
82+
be used to limit the range of angles plotted, producing sectors of a circle.
83+
84+
.. plot:: mpl_examples/pie_and_polar_charts/polar_sector_demo.py
85+
86+
Previous releases allowed plots containing negative radii for which the
87+
negative values are simply used as labels, and the real radius is shifted by
88+
the configured minimum. This release also allows negative radii to be used for
89+
grids and ticks, which were previously silently ignored.
90+
6391
New backend selection
6492
---------------------
6593

+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Demo of scatter plot on a polar axis, with offset origin.
3+
4+
Size increases radially in this example and color increases with angle (just to
5+
verify the symbols are being scattered correctly).
6+
7+
The main difference with the polar_scatter_demo is the configuration of the
8+
origin radius, producing an annulus. Additionally, the theta zero location is
9+
set to rotate the plot.
10+
"""
11+
import numpy as np
12+
import matplotlib.pyplot as plt
13+
14+
15+
N = 150
16+
r = 2 * np.random.rand(N)
17+
theta = 2 * np.pi * np.random.rand(N)
18+
area = 200 * r**2 * np.random.rand(N)
19+
colors = theta
20+
21+
ax = plt.subplot(111, polar=True)
22+
c = plt.scatter(theta, r, c=colors, s=area, cmap=plt.cm.hsv)
23+
c.set_alpha(0.75)
24+
25+
ax.set_rorigin(-2.5)
26+
ax.set_theta_zero_location('W', offset=10)
27+
28+
plt.show()
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
Demo of scatter plot on a polar axis confined to a sector.
3+
4+
Size increases radially in this example and color increases with angle (just to
5+
verify the symbols are being scattered correctly).
6+
7+
The main difference with the polar_scatter_demo is the configuration of the
8+
theta start and end limits, producing a sector instead of a full circle.
9+
"""
10+
import numpy as np
11+
import matplotlib.pyplot as plt
12+
13+
14+
N = 150
15+
r = 2 * np.random.rand(N)
16+
theta = 2 * np.pi * np.random.rand(N)
17+
area = 200 * r**2 * np.random.rand(N)
18+
colors = theta
19+
20+
ax = plt.subplot(111, polar=True)
21+
c = plt.scatter(theta, r, c=colors, s=area, cmap=plt.cm.hsv)
22+
c.set_alpha(0.75)
23+
24+
ax.set_thetamin(45)
25+
ax.set_thetamax(135)
26+
27+
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.