Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ gg2list <- function(p, width = NULL, height = NULL,
# the logic here is similar to what p$coordinates$aspect() does,
# but the ratio is scaled to the data range by plotly.js
fixed_coords <- c("CoordSf", "CoordFixed", "CoordMap", "CoordQuickmap")
if (inherits(p$coordinates, fixed_coords)) {
is_fixed <- isFALSE(p$coordinates$is_free())
if (inherits(p$coordinates, fixed_coords) || is_fixed) {
axisObj$scaleanchor <- anchor
ratio <- p$coordinates$ratio %||% 1
axisObj$scaleratio <- if (xy == "y") ratio else 1 / ratio
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-ggplot-labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ test_that("empty labels work", {
p <- ggplot(palmerpenguins::penguins,
aes(bill_length_mm, bill_depth_mm, color = species)) +
geom_point() +
labs(x = element_blank(), y = element_blank())
labs(x = NULL, y = NULL)
b <- expect_doppelganger_built(p, "labs-element-blank")
})
Loading