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

Functionalizing examples/pie_and_polar_charts #3577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add docstring and ax as parameter
  • Loading branch information
MC-Escherichia committed Sep 27, 2014
commit a7b8dfff76fd939eb113f6189e487ba1772bd7fd
30 changes: 27 additions & 3 deletions 30 examples/pie_and_polar_charts/polar_bar_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,34 @@
ex_radii = 10 * np.random.rand(N)
ex_width = np.pi / 4 * np.random.rand(N)

ax = plt.subplot(111, polar=True)

def polar_bar_demo(theta,radii,width):
def polar_bar_demo(ax,theta,radii,width):
"""
produces a randomly colored polar plot given three arrays,
theta, radii,width .

Parameters
----------
ax : PolarAxesSubplot
Axes on which to plot polar_bar

theta : array
Angles at which to plot polar bars

radii : array
lengths of polar bar

width : array
widths of polars bars

Returns
-------
ax : PolarAxesSubplot

Returns axes for further modification.
"""

ax = plt.subplot(111, polar=True)
bars = ax.bar(theta, radii, width=width, bottom=0.0)

# Use custom colors and opacity
Expand All @@ -24,4 +48,4 @@ def polar_bar_demo(theta,radii,width):
plt.show()
return ax

polar_bar_demo(ex_theta,ex_radii,ex_width)
polar_bar_demo(ax,ex_theta,ex_radii,ex_width)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.