@@ -189,13 +189,6 @@ eafdiffplot <-
189189 data_right <- transform_maximise(data_right , maximise )
190190 }
191191
192- compute_attsurfs <- function (x , cumsizes , percentiles , maximise ) {
193- x <- compute_eaf_call(x , cumsizes = cumsizes , percentiles = percentiles )
194- if (any(maximise ))
195- x [,- ncol(x )] <- transform_maximise(x [, - ncol(x ), drop = FALSE ], maximise )
196- eaf_as_list(x )
197- }
198-
199192 attsurfs_left <- attsurfs_right <- list ()
200193 if (! any(is.na(percentiles ))) {
201194 attsurfs_left <- compute_attsurfs(data_left , cumsizes_left , percentiles = percentiles , maximise = maximise )
@@ -262,7 +255,7 @@ eafdiffplot <-
262255
263256 # FIXME: This does not generate empty space between the two plots, but the
264257 # plots are not squared.
265- layout(matrix (1 : 2 , ncol = 2L , byrow = TRUE ), respect = TRUE )
258+ layout(matrix (c( 1L , 2L ) , ncol = 2L , byrow = TRUE ), respect = TRUE )
266259 bottommar <- 5L
267260 topmar <- 4L
268261 leftmar <- 4L
@@ -364,7 +357,7 @@ plot_eafdiff_side <- function (eafdiff, attsurfs = list(),
364357 # Colors are correct for !full.eaf && type == "area"
365358 if (full.eaf || type == " point" ) {
366359 diff_values <- eafdiff [,3L ]
367- eafdiff <- eafdiff [, 1L : 2L , drop = FALSE ]
360+ eafdiff <- eafdiff [, c( 1L , 2L ) , drop = FALSE ]
368361 # FIXME: This is wrong, we should color (0.0, 1] with col[1], then (1, 2]
369362 # with col[1], etc, so that we never color the value 0.0 but we always
370363 # color the maximum value color without having to force it.
@@ -406,6 +399,7 @@ plot_eafdiff_side <- function (eafdiff, attsurfs = list(),
406399 # # The maximum value should also be painted.
407400 diff_values [diff_values > length(col )] <- length(col )
408401 eafdiff <- eafdiff [order(diff_values , decreasing = FALSE ), , drop = FALSE ]
402+ diff_values <- diff_values [order(diff_values , decreasing = FALSE )]
409403 points(eafdiff [,1L ], eafdiff [,2L ], col = col [diff_values ], type = " p" , pch = 20 )
410404 }
411405 }
@@ -419,3 +413,11 @@ plot_eafdiff_side <- function (eafdiff, attsurfs = list(),
419413 mtext(title , 1 , line = 3.5 , cex = par(" cex.lab" ), las = 0 , font = 2 )
420414 box()
421415}
416+
417+ compute_attsurfs <- function (x , cumsizes , percentiles , maximise )
418+ {
419+ x <- compute_eaf_call(x , cumsizes = cumsizes , percentiles = percentiles )
420+ if (any(maximise ))
421+ x [,- ncol(x )] <- transform_maximise(x [, - ncol(x ), drop = FALSE ], maximise )
422+ eaf_as_list(x )
423+ }
0 commit comments