python - fourfold display in matplotlib using polar axis -


i trying create fourfold display in matplotlib:

enter image description here

but can't logic of polar axis. have tried far:

import numpy np import matplotlib.pyplot plt  # radius of each bar  radii = [10,  15, 20, 25]   # value - width  width = np.pi/ 2   # angle of each bar  theta = [0,90,180,270]  ax = plt.subplot(111, polar=true) bars = ax.bar(theta, radii, width=width) plt.show() 

not sure missing want 4 "equal" areas touch each others. can't work

  • how "control" angles ? mean have 4 "slides" being in [0,90], [90,180], [180, 270], [270, 360].

  • i not understand "width" corresponds to.

theta expected in radians, not degrees.

if tweak code:

import numpy np import matplotlib.pyplot plt  # radius of each bar radii = [10,  15, 20, 25]  # value - width width = np.pi/ 2  # angle of each bar theta = np.radians([0,90,180,270])  ax = plt.subplot(111, polar=true) bars = ax.bar(theta, radii, width=width, alpha=0.5) plt.show() 

you'll you'd expect:

enter image description here

on side note, exact plot you're making might make more sense use 4 wedges on rectangular plot centered spines.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -