Skip to content

Commit 4b438aa

Browse files
authored
add s and unittest (#400)
1 parent 3acd648 commit 4b438aa

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

ultraplot/axes/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ def _add_error_bars(
20872087
): # ugly kludge to check for shading
20882088
if all(_ is None for _ in (bardata, barstds, barpctiles)):
20892089
barstds, barpctiles = default_barstds, default_barpctiles
2090-
if all(_ is None for _ in (boxdata, boxstds, boxpctile)):
2090+
if all(_ is None for _ in (boxdata, boxstds, boxpctiles)):
20912091
boxstds, boxpctiles = default_boxstds, default_boxpctiles
20922092
showbars = any(
20932093
_ is not None and _ is not False for _ in (barstds, barpctiles, bardata)

ultraplot/tests/test_statistical_plotting.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,25 @@ def test_panel_dist(rng):
7171
px.hist(x, bins, color=color, fill=True, ec="k")
7272
px.format(grid=False, ylocator=[], title=title, titleloc="l")
7373
return fig
74+
75+
76+
@pytest.mark.mpl_image_compare
77+
def test_input_violin_box_options():
78+
"""
79+
Test various box options in violin plots.
80+
"""
81+
data = np.array([0, 1, 2, 3]).reshape(-1, 1)
82+
83+
fig, axes = uplt.subplots(ncols=4)
84+
axes[0].bar(data, median=True, boxpctiles=True, bars=False)
85+
axes[0].format(title="boxpctiles")
86+
87+
axes[1].bar(data, median=True, boxpctile=True, bars=False)
88+
axes[1].format(title="boxpctile")
89+
90+
axes[2].bar(data, median=True, boxstd=True, bars=False)
91+
axes[2].format(title="boxstd")
92+
93+
axes[3].bar(data, median=True, boxstds=True, bars=False)
94+
axes[3].format(title="boxstds")
95+
return fig

0 commit comments

Comments
 (0)