dwww Home | Show directory contents | Find package

p <- ggplot(data = data.frame(x = 0), mapping = aes(x = x)) 

test_that("ggplotly correctly handles stat_function", {
  pl <- p + 
    stat_function(fun = function(x) x^2+3) + 
    xlim(1, 5)

    expect_doppelganger(ggplotly(pl), "stat-function")
})

test_that("ggplotly correctly handles stat_function", {
  pl <- p + 
    geom_function(fun = function(x) x^2+3) + 
    stat_function(fun = function(x) 5) + 
    xlim(1, 5)

    expect_doppelganger(ggplotly(pl), "geomfunction")
})

Generated by dwww version 1.15 on Wed May 22 21:49:27 CEST 2024.