Skip to content

Commit 415c669

Browse files
committed
doc for propplot
1 parent c91d6c4 commit 415c669

9 files changed

Lines changed: 342 additions & 14 deletions

File tree

dabest/_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ def load(data, idx=None, x=None, y=None, paired=None, id_col=None,
8282
8383
>>> my_data = dabest.load(df, idx=("Control 1", "Test 1"))
8484
85+
For proportion plot.
86+
>>> np.random.seed(88888)
87+
>>> N = 10
88+
>>> c1 = np.random.binomial(1, 0.2, size=N)
89+
>>> t1 = np.random.binomial(1, 0.5, size=N)
90+
>>> df = pd.DataFrame({'Control 1' : c1, 'Test 1': t1})
91+
>>> my_data = dabest.load(df, idx=("Control 1", "Test 1"),proportional=True)
92+
93+
94+
8595
'''
8696
from ._classes import Dabest
8797

dabest/plotter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
269269

270270
# Initialise the figure.
271271
# sns.set(context="talk", style='ticks')
272-
init_fig_kwargs = dict(figsize=fig_size, dpi=plot_kwargs["dpi"])
273-
# ,tight_layout=True)
272+
init_fig_kwargs = dict(figsize=fig_size, dpi=plot_kwargs["dpi"]
273+
,tight_layout=True)
274274

275275
width_ratios_ga = [2.5, 1]
276276
h_space_cummings = 0.3
@@ -344,7 +344,7 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
344344
contrast_axes = axx[1]
345345
rawdata_axes.set_frame_on(False)
346346
contrast_axes.set_frame_on(False)
347-
fig.set_tight_layout(False)
347+
# fig.set_tight_layout(False)
348348

349349
redraw_axes_kwargs = {'colors' : ytick_color,
350350
'facecolors' : ytick_color,

dabest/tests/test_10_proportion_plot.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,11 @@
3838
def test_101_gardner_altman_unpaired_propdiff():
3939
return two_groups_unpaired.mean_diff.plot();
4040

41-
@pytest.mark.mpl_image_compare
42-
def test_102_gardner_altman_paired_propdiff():
43-
return two_groups_paired.mean_diff.plot();
44-
4541
@pytest.mark.mpl_image_compare
4642
def test_103_cummings_two_group_unpaired_propdiff():
4743
return two_groups_unpaired.mean_diff.plot(fig_size=(4, 6),
4844
float_contrast=False);
4945

50-
@pytest.mark.mpl_image_compare
51-
def test_104_cummings_two_group_paired_propdiff():
52-
return two_groups_paired.mean_diff.plot(fig_size=(6, 6),
53-
float_contrast=False);
54-
5546
@pytest.mark.mpl_image_compare
5647
def test_105_cummings_multi_group_unpaired__propdiff():
5748
return multi_2group.mean_diff.plot();

docs/source/_images/prop_1.png

19.3 KB
Loading

docs/source/_images/prop_2.png

15.4 KB
Loading

docs/source/_images/prop_3.png

21.1 KB
Loading

docs/source/_images/prop_4.png

18.5 KB
Loading

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
# Add any paths that contain custom static files (such as style sheets) here,
144144
# relative to this directory. They are copied after the builtin static files,
145145
# so a file named "default.css" will overwrite the builtin "default.css".
146-
html_static_path = ['_static/css']
146+
html_static_path = ['_static']
147147

148148

149149

@@ -228,4 +228,4 @@
228228
epub_exclude_files = ['search.html']
229229

230230
def setup(app):
231-
app.add_stylesheet('css/alabaster-custom.css')
231+
app.add_css_file('css/alabaster-custom.css')

0 commit comments

Comments
 (0)