Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d1efead

Browse files
Take changes from #2440
1 parent e217ca8 commit d1efead

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎R/ggplotly.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,8 @@ gg2list <- function(p, width = NULL, height = NULL,
784784
# the logic here is similar to what p$coordinates$aspect() does,
785785
# but the ratio is scaled to the data range by plotly.js
786786
fixed_coords <- c("CoordSf", "CoordFixed", "CoordMap", "CoordQuickmap")
787-
if (inherits(p$coordinates, fixed_coords)) {
787+
is_fixed <- isFALSE(p$coordinates$is_free())
788+
if (inherits(p$coordinates, fixed_coords) || is_fixed) {
788789
axisObj$scaleanchor <- anchor
789790
ratio <- p$coordinates$ratio %||% 1
790791
axisObj$scaleratio <- if (xy == "y") ratio else 1 / ratio

‎tests/testthat/test-ggplot-labels.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ test_that("empty labels work", {
5151
p <- ggplot(palmerpenguins::penguins,
5252
aes(bill_length_mm, bill_depth_mm, color = species)) +
5353
geom_point() +
54-
labs(x = element_blank(), y = element_blank())
54+
labs(x = NULL, y = NULL)
5555
b <- expect_doppelganger_built(p, "labs-element-blank")
5656
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /