Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 585df43 commit eb5bfe4Copy full SHA for eb5bfe4
lib/matplotlib/tests/test_axes.py
@@ -2902,6 +2902,30 @@ def test_errorbar_with_prop_cycle():
2902
ax.errorbar(x=[2, 4, 10], y=[6, 4, 2], yerr=0.5)
2903
2904
2905
+@check_figures_equal()
2906
+def test_errorbar_offsets(fig_test, fig_ref):
2907
+ x = np.linspace(0, 1, 15)
2908
+ y = x * (1-x)
2909
+ yerr = y/6
2910
+
2911
+ ax_ref = fig_ref.subplots()
2912
+ ax_test = fig_test.subplots()
2913
2914
2915
+ for color, shift in zip('rgbk', [0, 0, 2, 7]):
2916
+ y += .02
2917
2918
+ #Using feature in question
2919
+ ax_test.errorbar(x, y, yerr, errorevery=(shift, 4),
2920
+ capsize=4, c=color)
2921
2922
+ #Using manual errorbars
2923
+ #n.b. errorbar draws the main plot at z=2.1 by default
2924
+ ax_ref.plot(x, y, c=color, zorder=2.1)
2925
+ ax_ref.errorbar(x[shift::4], y[shift::4], yerr[shift::4],
2926
+ capsize=4, c=color, fmt='none')
2927
2928
2929
@image_comparison(baseline_images=['hist_stacked_stepfilled',
2930
'hist_stacked_stepfilled'])
2931
def test_hist_stacked_stepfilled():
0 commit comments