Skip to content

geom_abline 3.3.4 odd y limits #4514

Closed
Closed
@arnaud-feldmann

Description

@arnaud-feldmann

Hi,

I am aware of #4024 and #3741 that modify geom_abline. Through, the abline modification in 3.3.4 has had some strange results for the default y limits, maintening my modest package disaggR and in particular its autoplot method for in_scatter. I can't decide if it's a feature or a bug, I'm sorry if I make a mistake to report that.

object <- in_scatter(twoStepsBenchmark(turnover,construction))
n <- nrow(object)
df <- data.frame(Time=as.numeric(time(object))[-1L],
                 `High-frequency serie` = object[-n,2L],
                 `Low-frequency serie` = object[-n,1L],
                 xend = object[-1L,2L],
                 yend = object[-1L,1L], check.names = FALSE)

ggplot() +
  geom_abline(intercept = attr(object,"coefficients")["constant"],
                       slope = attr(object,"coefficients")[names(attr(object,"coefficients")) != "constant"],
                       lty = "solid", colour = "red", size = 1)  +
  geom_segment(data=df,
               aes(x = `High-frequency serie`, y = `Low-frequency serie`,
                   xend = xend, yend = yend,
                   colour = Time),
               arrow=arrow(angle = 15,
                           ends = "last",
                           type = "closed",
                           length = unit(0.1,"inches")),
               na.rm = TRUE)

On 3.3.4 The default y limits seems to be very odd to me
image

on 3.3.3 the behavior was as expected
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions