| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,3 +2,6 @@ Fixed errorbars in polar plots | |||
| 2 | 2 | ------------------------------ | |
| 3 | 3 | Caps and error lines are now drawn with respect to polar coordinates, | |
| 4 | 4 | when plotting errorbars on polar plots. | |
| 5 | + | ||
| 6 | + .. figure:: /gallery/pie_and_polar_charts/images/sphx_glr_polar_error_caps_001.png | ||
| 7 | + :target: ../../gallery/pie_and_polar_charts/polar_error_caps.html | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + """ | ||
| 2 | + ================================= | ||
| 3 | + Error bar rendering on polar axis | ||
| 4 | + ================================= | ||
| 5 | + | ||
| 6 | + Demo of error bar plot in polar coordinates. | ||
| 7 | + """ | ||
| 8 | + import numpy as np | ||
| 9 | + import matplotlib.pyplot as plt | ||
| 10 | + | ||
| 11 | + fig = plt.figure(figsize=(10, 10)) | ||
| 12 | + ax = plt.subplot(111, projection='polar') | ||
| 13 | + theta = np.arange(0, 2*np.pi, np.pi / 4) | ||
| 14 | + r = theta / np.pi / 2 + 0.5 | ||
| 15 | + ax.errorbar(theta, r, xerr=0.25, yerr=0.1, capsize=7, fmt="o") | ||
| 16 | + plt.show() | ||
| 17 | + | ||
| 18 | + ############################################################################# | ||
| 19 | + # | ||
| 20 | + # .. admonition:: References | ||
| 21 | + # | ||
| 22 | + # The use of the following functions, methods, classes and modules is shown | ||
| 23 | + # in this example: | ||
| 24 | + # | ||
| 25 | + # - `matplotlib.axes.Axes.errorbar` / `matplotlib.pyplot.errorbar` | ||
| 26 | + # - `matplotlib.projections.polar` | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments