Skip to content

wrapping of labels not supported in ggplotly #851

@earowang

Description

@earowang

Hi Carson,

ggplot2 works fine for the wrapping of long labels, while ggplotly doesn't support yet. A little example is as follows:

library(plotly)
library(stringr)

df_x <- data.frame(
  x = "this is very loooooooooooong text to illustrate",
  y = 100
)

p <- ggplot(aes(x = x, y = y), data = df_x) +
  geom_bar(stat = "identity") +
  scale_x_discrete(labels = function(x) str_wrap(x, width = 10))
p
ggplotly(p)

Cheers,
Earo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions