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

Commit 5dce348

Browse filesBrowse files
committed
Merge pull request #2447 from phobson/bug-boxplots-with-manual-CIarray
BUG: Fix boxplots with manual confidence intervals passed as a numpy array
2 parents 4b8ec14 + 3a97057 commit 5dce348
Copy full SHA for 5dce348

File tree

Expand file treeCollapse file tree

3 files changed

+16
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+16
-1
lines changed

‎lib/matplotlib/axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5990,7 +5990,7 @@ def computeConfInterval(data, med, iq, bootstrap):
59905990
raise ValueError(msg1)
59915991
elif conf_intervals.shape[0] != col:
59925992
raise ValueError(msg2)
5993-
elif conf_intervals.shape[1] == 2:
5993+
elif conf_intervals.shape[1] != 2:
59945994
raise ValueError(msg3)
59955995
else:
59965996
if len(conf_intervals) != col:
Loading

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,21 @@ def test_boxplot():
985985
conf_intervals=[None, (-1.0, 3.5)], notch=1)
986986
ax.set_ylim((-30, 30))
987987

988+
@image_comparison(baseline_images=['boxplot_with_CIarray'],
989+
remove_text=True, extensions=['png'],
990+
savefig_kwarg={'dpi': 40})
991+
def test_boxplot_with_CIarray():
992+
x = np.linspace(-7, 7, 140)
993+
x = np.hstack([-25, x, 25])
994+
fig = plt.figure()
995+
ax = fig.add_subplot(111)
996+
CIs = np.array([[-1.5, 3.], [-1., 3.5]])
997+
998+
# show 1 boxplot with mpl medians/conf. interfals, 1 with manual values
999+
ax.boxplot([x, x], bootstrap=10000, usermedians=[None, 1.0],
1000+
conf_intervals=CIs, notch=1)
1001+
ax.set_ylim((-30, 30))
1002+
9881003
@image_comparison(baseline_images=['boxplot_no_inverted_whisker'],
9891004
remove_text=True, extensions=['png'],
9901005
savefig_kwarg={'dpi': 40})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.