Skip to content

Smart axis type defaults #578

@royr2

Description

@royr2

@cpsievert @timelyportfolio I was trying to answer this question on SO and came across this:

library(plotly)

df <- data.frame(x = c(1, 2, 4, 8, 16, 32), y = 1:6)
df$x <- as.factor(df$x)
# Works fine
p <- ggplot(df, aes(x = x, y = y)) + geom_point()
p

image

# Looks wrong
pp <- plot_ly(df, x = x, y = y, mode = "markers")
pp

image

# works fine
ggplotly(p)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions