Skip to content

Commit 3a771df

Browse files
committed
Merge propplot
1 parent adaf819 commit 3a771df

6 files changed

Lines changed: 40 additions & 4 deletions

File tree

dabest/_api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ def load(data, idx=None, x=None, y=None, paired=None, id_col=None,
4646
bootstrap resampling, ensuring that the confidence intervals
4747
reported are replicable.
4848
proportional : boolean, default False.
49-
TO INCLUDE MORE DESCRIPTION ABOUT DATA FORMAT
49+
An indicator of whether the data is binary or not. When set to True, it
50+
specifies that the data consists of binary data, where the values are
51+
limited to 0 and 1. The code is not suitable for analyzing proportion
52+
data that contains non-numeric values, such as strings like ‘yes’ and ‘no’.
53+
When False or not provided, the algorithm assumes that
54+
the data is continuous and uses a non-proportional representation.
5055
delta2 : boolean, default False
5156
Indicator of delta-delta experiment
5257
experiment : String, default None

dabest/_classes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,8 +2708,6 @@ def __pre_calc(self):
27082708
reprs.append(text_repr)
27092709

27102710

2711-
reprs.insert(0, print_greeting())
2712-
27132711
self.__for_print = "\n\n".join(reprs)
27142712

27152713
out_ = pd.DataFrame(out)
@@ -2785,6 +2783,7 @@ def __pre_calc(self):
27852783
"use `{}.{}.statistical_tests`".format(varname, self.__effect_size)
27862784
reprs.append(lastline)
27872785

2786+
reprs.insert(0, print_greeting())
27882787

27892788
self.__for_print = "\n\n".join(reprs)
27902789

docs/source/_images/prop_5.png

19.3 KB
Loading

docs/source/_images/prop_6.png

16.2 KB
Loading

docs/source/_images/prop_7.png

19.3 KB
Loading

docs/source/proportion-plot.rst

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ This will plot the bootstrap effect sizes below the raw data.
297297
298298
.. image:: _images/prop_3.png
299299

300-
You can also modify the width of bars as you expect by setting ``bar_width`` in the ``plot()`` method. The color of error bar can be modified by setting 'err_color'.
300+
You can also modify the width of bars as you expect by setting ``bar_width`` in the ``plot()`` method.
301301

302302
.. code-block:: python3
303303
:linenos:
@@ -307,6 +307,38 @@ You can also modify the width of bars as you expect by setting ``bar_width`` in
307307
308308
.. image:: _images/prop_4.png
309309

310+
311+
The ``bar_desat`` is used to control the amount of desaturation applied to the bar colors. A value of 0.0 means full desaturation (i.e., grayscale),
312+
while a value of 1.0 means no desaturation (i.e., full color saturation). Default is 0.8.
313+
314+
.. code-block:: python3
315+
:linenos:
316+
317+
318+
two_groups_unpaired.mean_diff.plot(bar_desat=1.0);
319+
320+
.. image:: _images/prop_5.png
321+
322+
``bar_label`` and ``contrast_label`` can be used to set labels for the y-axis of the bar plot and the contrast plot.
323+
324+
.. code-block:: python3
325+
:linenos:
326+
327+
328+
two_groups_unpaired.mean_diff.plot(bar_label="success",contrast_label="difference");
329+
330+
.. image:: _images/prop_6.png
331+
332+
The color of error bar can be modified by setting 'err_color'.
333+
334+
.. code-block:: python3
335+
:linenos:
336+
337+
338+
two_groups_unpaired.mean_diff.plot(err_color="purple");
339+
340+
.. image:: _images/prop_7.png
341+
310342
Producing Paired Proportion Plots
311343
---------------------------------
312344
For paired version of proportional plot, we adapt the style of Sankey Diagram. The width of each bar in each xticks represent

0 commit comments

Comments
 (0)