Closed
Description
This StackOverflow question https://stackoverflow.com/q/61888967/2554330 motivated this report.
If the labels in scale_x_discrete
are a factor, ggplot
works fine. This is okay:
ggplot(diamonds, aes(cut)) +
geom_bar() +
scale_x_discrete("Cut", labels=factor(letters[1:5]))
However, ggplotly()
fails:
ggplotly(
ggplot(diamonds, aes(cut)) +
geom_bar() +
scale_x_discrete("Cut", labels=factor(letters[1:5]))
)
#> Error in nchar(axisObj$ticktext): 'nchar()' requires a character vector
Apparently an as.character()
call is needed when ticktext
is constructed.
Metadata
Metadata
Assignees
Labels
No labels