diff --git a/R/002_plot_api.R b/R/002_plot_api.R index c07aeb4..6f0141d 100644 --- a/R/002_plot_api.R +++ b/R/002_plot_api.R @@ -481,7 +481,8 @@ plot_delta <- function(dabest_effectsize_obj, float_contrast, plot_kwargs) { ### Preparing delta dots data delta_dots <- plot_kwargs$delta_dots - if (is_paired && delta_dots) { + show_delta_dots <- (is_paired && !(proportional) && delta_dots) + if (show_delta_dots) { delta_dots_data <- create_delta_dots_data(dabest_effectsize_obj, x_axis_breaks) delta_y_min <- min(delta_dots_data$y_var) delta_y_max <- max(delta_dots_data$y_var) @@ -635,8 +636,7 @@ plot_delta <- function(dabest_effectsize_obj, float_contrast, plot_kwargs) { ) } ### Add delta dots if requested - delta_dots <- plot_kwargs$delta_dots - if (is_paired && delta_dots) { + if (show_delta_dots) { delta_plot <- add_delta_dots_to_delta_plot( delta_plot, dabest_effectsize_obj, diff --git a/tests/testthat/_snaps/001_plotter/proportion-baseline-flow-false-mean-diff.svg b/tests/testthat/_snaps/001_plotter/proportion-baseline-flow-false-mean-diff.svg index 7394b97..0ce7771 100644 --- a/tests/testthat/_snaps/001_plotter/proportion-baseline-flow-false-mean-diff.svg +++ b/tests/testthat/_snaps/001_plotter/proportion-baseline-flow-false-mean-diff.svg @@ -21,96 +21,96 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.00 -0.25 -0.50 -0.75 -1.00 - - - - - -Control 1 -v.s. - Test 1 -N= 40 -Test 1 -v.s. - Test 2 -N= 40 -Test 2 -v.s. - Test 3 -N= 40 -Control 2 -v.s. - Test 4 -N= 40 -proportion of success + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + +Control 1 +v.s. + Test 1 +N= 40 +Test 1 +v.s. + Test 2 +N= 40 +Test 2 +v.s. + Test 3 +N= 40 +Control 2 +v.s. + Test 4 +N= 40 +proportion of success @@ -118,123 +118,60 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - -+0.35 -+0.12 -+0.05 -+0.35 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1.0 --0.5 -0.0 -0.5 -1.0 - - - - - -Test 1 -minus -Control 1 -Test 2 -minus -Control 1 -Test 3 -minus -Control 1 -Test 4 -minus -Control 2 + + + + + + + + + + + + + + + + + + + + + + + + ++0.35 ++0.12 ++0.05 ++0.35 + +-0.25 +0.00 +0.25 +0.50 +0.75 + + + + + +Test 1 +minus +Control 1 +Test 2 +minus +Control 1 +Test 3 +minus +Control 1 +Test 4 +minus +Control 2 Paired mean difference diff --git a/tests/testthat/_snaps/001_plotter/proportion-baseline-mean-diff.svg b/tests/testthat/_snaps/001_plotter/proportion-baseline-mean-diff.svg index a5277c6..343c424 100644 --- a/tests/testthat/_snaps/001_plotter/proportion-baseline-mean-diff.svg +++ b/tests/testthat/_snaps/001_plotter/proportion-baseline-mean-diff.svg @@ -21,86 +21,86 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.00 -0.25 -0.50 -0.75 -1.00 - - - - - -Control 1 -N = 40 -Test 1 -N = 40 -Test 2 -N = 40 -Test 3 -N = 40 -Control 2 -N = 40 -Test 4 -N = 40 -proportion of success + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + +Control 1 +N = 40 +Test 1 +N = 40 +Test 2 +N = 40 +Test 3 +N = 40 +Control 2 +N = 40 +Test 4 +N = 40 +proportion of success @@ -108,143 +108,66 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+0.35 -+0.12 -+0.05 -+0.35 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1.0 --0.5 -0.0 -0.5 -1.0 - - - - - -Test 1 -minus -Control 1 -Test 2 -minus -Control 1 -Test 3 -minus -Control 1 -Test 4 -minus -Control 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++0.35 ++0.12 ++0.05 ++0.35 + +-0.25 +0.00 +0.25 +0.50 +0.75 + + + + + +Test 1 +minus +Control 1 +Test 2 +minus +Control 1 +Test 3 +minus +Control 1 +Test 4 +minus +Control 2 Paired mean difference diff --git a/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-false.svg b/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-false.svg index cbcfa04..dca84ed 100644 --- a/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-false.svg +++ b/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-false.svg @@ -21,45 +21,45 @@ - + - + - - - - - - - - - - - - - - - - - -0.00 -0.25 -0.50 -0.75 -1.00 - - - - - -Control 1 -N = 40 -Test 1 -N = 40 -proportion of success + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + +Control 1 +N = 40 +Test 1 +N = 40 +proportion of success @@ -67,75 +67,33 @@ - + - - - - - - - - - - - -+0.35 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1.0 --0.5 -0.0 -0.5 -1.0 - - - - - -Test 1 -minus -Control 1 + + + + + + + + + + + ++0.35 + +0.0 +0.2 +0.4 +0.6 + + + + +Test 1 +minus +Control 1 Paired mean difference diff --git a/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-true.svg b/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-true.svg index b6d81bd..366eb6a 100644 --- a/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-true.svg +++ b/tests/testthat/_snaps/001_plotter/proportion-paired-mean-diff-float-true.svg @@ -86,46 +86,6 @@ +0.35 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/testthat/_snaps/001_plotter/proportion-sequential-mean-diff.svg b/tests/testthat/_snaps/001_plotter/proportion-sequential-mean-diff.svg index 0f2b8fb..979deb6 100644 --- a/tests/testthat/_snaps/001_plotter/proportion-sequential-mean-diff.svg +++ b/tests/testthat/_snaps/001_plotter/proportion-sequential-mean-diff.svg @@ -112,134 +112,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+0.35 --0.23 --0.07 -+0.35 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++0.35 +-0.23 +-0.07 ++0.35 --1.0 --0.5 -0.0 -0.5 -1.0 - - - - - +-0.4 +0.0 +0.4 + + + Test 1 minus Control 1