Comments (3)
Hi @johannesbjork, firstly thank you for your clear and reproducible example!
While it is possible (as you have demonstrated) to manually change the contrast axis for a Gardner-Altman plot (float_contrast=False
), the alignment between the rawdata axis and the contrast axis will be broken. This is why the position of the zero and mean difference lines are misaligned between the axes.
As such, for a Gardner-Altman plot, setting the contrast_ylim
option does not do anything in dabest.plot()
.
Currently, the way a Gardner-Altman plot is generated is: plot the raw data on the rawdata axis, plot the bootstrap contrast on the contrast axis, and then align the contrast axis to the rawdata axis. Given that both axis are shifted by a linear scalar, I suppose the process could be reversed (set the y-limits for the contrast axis, then align the rawdata axis to it). I don't see such a feature being implemented anytime soon.
If you really want to control the contrast axis y-limits and tick locations, I'd suggest using a Cumming plot, where the bootstrap distributions and effect sizes are plotted below instead of alongside the raw data.
f, r = dabest.plot(df, idx=(('Group 2','Group 3'),('Group 4','Group 5')),
float_contrast=False,
contrast_ylim=(-1,2)
)
contrast_axes = f.axes[2]
contrast_axes.yaxis.set_major_locator(ticker.MultipleLocator(0.5))
contrast_axes.yaxis.set_minor_locator(ticker.MultipleLocator(0.25))
PS Have you taken a look at our R version dabestr? You might find it more helpful if you're more familiar with R!
from dabest-python.
from dabest-python.
ooops, my bad!
from dabest-python.
Related Issues (20)
- color_col formatting HOT 2
- pandas version conflicts HOT 2
- Plot ONLY mean diff HOT 1
- Error with dataframes containing non-string column names HOT 3
- Is it possible to get access to the underlying bootstrap samples generated to obtain the 95% CI for ES? HOT 1
- cannot plot the figures HOT 3
- Estimation plot only HOT 1
- Warning: Not all points displayed... HOT 2
- Are multi-group p-values corrected for multiple comparisons? HOT 2
- contrast_ylim does not work for matplotlib HOT 1
- DABEST calculation of median difference CIs often fails HOT 5
- Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o, : estimated adjustment 'a' is NA HOT 1
- New Release: v2023.02.14
- Error in changing the the linewidth of the lines used to join each pair of observations HOT 1
- Possibility to do mixed model statistics ? HOT 2
- Little problems with the plots HOT 3
- Limitation of paired analysis: Statistics comparing to only one group instead of with each other
- delta_g does not plot together with hedges_g
- Options for plot appearance HOT 2
- cannot plot figure - 'numpy.ndarray' object has no attribute 'categories' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dabest-python.