Skip to content

ggplotly overwrites title size when using theme() #447

@royr2

Description

@royr2

Seems to affect only plot.title. Arguments passed to element_text() do not seem to affect the chart.

library(plotly)
set.seed(123)

df <- diamonds[sample(1:nrow(diamonds), size = 1000),]

p <- ggplot(df, aes(carat, price)) +
  geom_point() + 
  labs(title = "Diamonds", x = "x-axis -> Carat", y = "y-axis -> Price") +
  theme(plot.title = element_text(size = 50, colour = "blue"),  
        axis.title.x = element_text(size = 20, colour = "red"),  
        axis.title.y = element_text(size = 20, colour = "green"))  
p
ggplotly()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions