Skip to content

Commit 896f276

Browse files
committed
Fixed contrast axis issue with float_contrast, and updated readme and tutorials
> Fixed float contrast =True, contrast axis xlim > Updated Tutorials > Updated readme
1 parent 67f5232 commit 896f276

21 files changed

+92
-78
lines changed

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,28 @@ performance improvements. It’s a big one!
4040

4141
5. **Other Visualization Improvements**:
4242

43-
- **Raw, Contrast, and Summary bars**: We added bars highlighting
44-
the various groups’ differences. These bars can be customized to
45-
suit the user’s needs. Raw and contrast bars are provided by
46-
default, summary bars can be added by the user. See the relevant
47-
sections in the [Plot
48-
Aesthetics](../tutorials/09-plot_aesthetics.html) tutorial for
49-
more details.
43+
- **Raw, Contrast, and Summary bars**: Our visualization package now
44+
includes three types of customizable bars to enhance data
45+
interpretation:
46+
47+
- **Raw Bars**: Colored rectangles that extend from the zero line
48+
to the mean of each group’s raw data. These bars visually
49+
highlight the central tendency of the raw data.
50+
51+
- **Contrast Bars**: Similar to raw bars, these highlight the
52+
effect size difference between two groups (typically test and
53+
control) in the contrast axis. They provide a visual
54+
representation of the differences between groups.
55+
56+
- **Summary Bars**: Optional horizontal bars that can be added to
57+
emphasize a specific effect size across the entire contrast
58+
axis. Unlike raw and contrast bars, these span horizontally and
59+
are not displayed by default.
60+
61+
By default, plots show raw and contrast bars. Users can
62+
customize these bars and add summary bars as needed. For
63+
detailed customization instructions, please refer to the [Plot
64+
Aesthetics](../tutorials/09-plot_aesthetics.html) tutorial.
5065

5166
- **Tighter spacing in Delta-Delta and Mini-Meta Plots**: We have
5267
adjusted the spacing of delta-delta and mini-meta plots to reduce
@@ -172,7 +187,7 @@ allowing everyone access to high-quality estimation plots.
172187

173188
## Installation
174189

175-
This package is tested on Python 3.10 and onwards. It is highly
190+
This package is tested on Python 3.11 and onwards. It is highly
176191
recommended to download the [Anaconda
177192
distribution](https://www.continuum.io/downloads) of Python in order to
178193
obtain the dependencies easily.

dabest/misc_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ def set_xaxis_ticks_and_lims(
12361236
if float_contrast:
12371237
contrast_axes.set_xlim(0.5, 1.5)
12381238

1239-
if show_delta2:
1239+
elif show_delta2:
12401240
if show_pairs:
12411241
rawdata_axes.set_xlim(-0.375, 4.75)
12421242
else:

dabest/plotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def effectsize_df_plotter(effectsize_df: object, **plot_kwargs) -> matplotlib.fi
449449
else effectsize_df.delta_delta.difference if show_delta2
450450
else None),
451451
)
452-
452+
453453
## Make sure the contrast_axes x-lims match the rawdata_axes xlims,
454454
## and add an extra violinplot tick for delta-delta plot.
455455
## Name is xaxis but it is actually y-axis for horizontal plots

nbs/API/misc_tools.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@
12891289
" if float_contrast:\n",
12901290
" contrast_axes.set_xlim(0.5, 1.5)\n",
12911291
"\n",
1292-
" if show_delta2:\n",
1292+
" elif show_delta2:\n",
12931293
" if show_pairs:\n",
12941294
" rawdata_axes.set_xlim(-0.375, 4.75)\n",
12951295
" else:\n",

nbs/API/plotter.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
" else effectsize_df.delta_delta.difference if show_delta2\n",
507507
" else None),\n",
508508
" )\n",
509-
" \n",
509+
"\n",
510510
" ## Make sure the contrast_axes x-lims match the rawdata_axes xlims,\n",
511511
" ## and add an extra violinplot tick for delta-delta plot.\n",
512512
" ## Name is xaxis but it is actually y-axis for horizontal plots\n",

nbs/read_me.ipynb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@
4040
"4. **Gridkey**: Users can now represent experimental labels in a ‘gridkey’ table. This can be accessed with the `gridkey` parameter in the `plot()` method. See the gridkey section in the [Plot Aesthetics](../tutorials/09-plot_aesthetics.html) tutorial for more details.\n",
4141
"\n",
4242
"5. **Other Visualization Improvements**:\n",
43-
" - **Raw, Contrast, and Summary bars**: We added bars highlighting the various groups' differences. These bars can be customized to suit the user’s needs. Raw and contrast bars are provided by default, summary bars can be added by the user. See the relevant sections in the [Plot Aesthetics](../tutorials/09-plot_aesthetics.html) tutorial for more details.\n",
44-
" \n",
43+
" - **Raw, Contrast, and Summary bars**: Our visualization package now includes three types of customizable bars to enhance data interpretation:\n",
44+
" - **Raw Bars**: Colored rectangles that extend from the zero line to the mean of each group's raw data. These bars visually highlight the central tendency of the raw data.\n",
45+
" - **Contrast Bars**: Similar to raw bars, these highlight the effect size difference between two groups (typically test and control) in the contrast axis. They provide a visual representation of the differences between groups.\n",
46+
" - **Summary Bars**: Optional horizontal bars that can be added to emphasize a specific effect size across the entire contrast axis. Unlike raw and contrast bars, these span horizontally and are not displayed by default.\n",
47+
"\n",
48+
" By default, plots show raw and contrast bars. Users can customize these bars and add summary bars as needed. For detailed customization instructions, please refer to the [Plot Aesthetics](../tutorials/09-plot_aesthetics.html) tutorial.\n",
49+
"\n",
4550
" - **Tighter spacing in Delta-Delta and Mini-Meta Plots**: We have adjusted the spacing of delta-delta and mini-meta plots to reduce whitespace. The new format brings the overall effect size closer to the two-groups effect sizes. In addition, delta-delta plots now have a gap in the zero line to separate the delta-delta from the ∆ effect sizes.\n",
4651
"\n",
4752
" - **Delta-Delta Effect Sizes for Proportion Plots**: In addition to continuous data, delta-delta plots now support binary data (proportions). This means that 2-way designs for binary outcomes can be analyzed with DABEST.\n",
@@ -118,7 +123,7 @@
118123
"source": [
119124
"## Installation\n",
120125
"\n",
121-
"This package is tested on Python 3.10 and onwards.\n",
126+
"This package is tested on Python 3.11 and onwards.\n",
122127
"It is highly recommended to download the [Anaconda distribution](https://www.continuum.io/downloads) of Python in order to obtain the dependencies easily.\n",
123128
"\n",
124129
"You can install this package via `pip`.\n",
@@ -232,12 +237,6 @@
232237
"\n",
233238
"DABEST is also available in R ([dabestr](https://github.com/ACCLAB/dabestr)) and Matlab ([DABEST-Matlab](https://github.com/ACCLAB/DABEST-Matlab)).\n"
234239
]
235-
},
236-
{
237-
"cell_type": "markdown",
238-
"id": "7106313a",
239-
"metadata": {},
240-
"source": []
241240
}
242241
],
243242
"metadata": {
17 Bytes
Loading
-45 Bytes
Loading
-42 Bytes
Loading
8 Bytes
Loading

0 commit comments

Comments
 (0)