Skip to content

Alignment of ggtitle #781

Open
Open
@soedr

Description

@soedr

First off, thank you for an incredible set of packages!

I'm facing an issue where the ggplot2 title aesthetics are not translated through ggplotyl(); more precisely, the horizontal title adjustment theme(plot.title = element_text(hjust = 0)) is ignored.

Code below:

library(ggthemes)
library(plotly)

set.seed(12345)
v <- runif(100, min=0, max=100)
df <- as.data.frame(v)
names(df) <- c("pressure")

t <- ggplot(df, aes(x = pressure)) +
  geom_histogram(bins = 20, alpha = 0.7, position = "identity") +
  scale_fill_fivethirtyeight(label = comma) +
  theme_tufte(base_size = 7, base_family = "Avenir") +
  labs(x =  "pressure", "# observations", title = "pressure plot") +
  theme(plot.title = element_text(hjust = 0)) +
  theme(axis.ticks = element_blank()) +
  scale_x_continuous()
(gg <- ggplotly(t))

Is there another way to define the location of text elements? Thanks!

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