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 0741bc7 commit 5394e84Copy full SHA for 5394e84
lib/matplotlib/tests/test_axes.py
@@ -2945,6 +2945,30 @@ def test_errorbar_with_prop_cycle():
2945
ax.errorbar(x=[2, 4, 10], y=[6, 4, 2], yerr=0.5)
2946
2947
2948
+@check_figures_equal()
2949
+def test_errorbar_offsets(fig_test, fig_ref):
2950
+ x = np.linspace(0, 1, 15)
2951
+ y = x * (1-x)
2952
+ yerr = y/6
2953
+
2954
+ ax_ref = fig_ref.subplots()
2955
+ ax_test = fig_test.subplots()
2956
2957
2958
+ for color, shift in zip('rgbk', [0, 0, 2, 7]):
2959
+ y += .02
2960
2961
+ #Using feature in question
2962
+ ax_test.errorbar(x, y, yerr, errorevery=(shift, 4),
2963
+ capsize=4, c=color)
2964
2965
+ #Using manual errorbars
2966
+ #n.b. errorbar draws the main plot at z=2.1 by default
2967
+ ax_ref.plot(x, y, c=color, zorder=2.1)
2968
+ ax_ref.errorbar(x[shift::4], y[shift::4], yerr[shift::4],
2969
+ capsize=4, c=color, fmt='none')
2970
2971
2972
@image_comparison(baseline_images=['hist_stacked_stepfilled',
2973
'hist_stacked_stepfilled'])
2974
def test_hist_stacked_stepfilled():
0 commit comments