Hands-on Matplotlib by Ashwin Pajankar

Hands-on Matplotlib by Ashwin Pajankar

Author:Ashwin Pajankar
Language: eng
Format: epub
ISBN: 9781484274101
Publisher: Apress


Polar Charts

You can also create polar graphs that are in the shape of pie charts. However, a fundamental difference from the Cartesian (X-Y) coordinate system is that in a polar chart the coordinate system is radially arranged, so you need the angle (theta) and distance from the origin (r is the radius) to visualize a point or set of points. Let’s create a dataset as follows:N = 20

theta = np.linspace(0.0, 2 * np.pi, N)

r = 10 * np.random.rand(N)

The set of points can be visualized as follows:plt.subplot(projection='polar')

plt.bar(theta, r, bottom=0.0,

color=['r', 'g', 'b'], alpha=0.2)

plt.show()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.