Giter VIP home page Giter VIP logo

Comments (3)

josesho avatar josesho commented on May 30, 2024

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))

download

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.

johannesbjork avatar johannesbjork commented on May 30, 2024

from dabest-python.

josesho avatar josesho commented on May 30, 2024

ooops, my bad!

from dabest-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.