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 89e51a6 commit 31374b4Copy full SHA for 31374b4
lib/matplotlib/tests/test_axes.py
@@ -2986,6 +2986,30 @@ def test_errorbar_with_prop_cycle():
2986
ax.errorbar(x=[2, 4, 10], y=[6, 4, 2], yerr=0.5)
2987
2988
2989
+@check_figures_equal()
2990
+def test_errorbar_offsets(fig_test, fig_ref):
2991
+ x = np.linspace(0, 1, 15)
2992
+ y = x * (1-x)
2993
+ yerr = y/6
2994
+
2995
+ ax_ref = fig_ref.subplots()
2996
+ ax_test = fig_test.subplots()
2997
2998
2999
+ for color, shift in zip('rgbk', [0, 0, 2, 7]):
3000
+ y += .02
3001
3002
+ #Using feature in question
3003
+ ax_test.errorbar(x, y, yerr, errorevery=(shift, 4),
3004
+ capsize=4, c=color)
3005
3006
+ #Using manual errorbars
3007
+ #n.b. errorbar draws the main plot at z=2.1 by default
3008
+ ax_ref.plot(x, y, c=color, zorder=2.1)
3009
+ ax_ref.errorbar(x[shift::4], y[shift::4], yerr[shift::4],
3010
+ capsize=4, c=color, fmt='none')
3011
3012
3013
@image_comparison(baseline_images=['hist_stacked_stepfilled',
3014
'hist_stacked_stepfilled'])
3015
def test_hist_stacked_stepfilled():
0 commit comments