Skip to content

support title alignment with the plot introduced in ggplot2 3.3.0 #152

@IndrajeetPatil

Description

@IndrajeetPatil

The latest (3.3.0) release of ggplot2 introduced a way to align the plot titles with the plot:

# setup
set.seed(123)
library(ggplot2)
library(ggExtra)

# basic plot
p <- 
  ggplot(mtcars, aes(wt, mpg)) + geom_point() +
  labs(title = "this title is aligned with the plot and not the axis") + 
  theme(plot.title.position = "plot")

# title aligned with the plot
plot(p)

But this alignment is removed by ggExtra:

# setup
set.seed(123)
library(ggplot2)
library(ggExtra)

# basic plot
p <- 
  ggplot(mtcars, aes(wt, mpg)) + geom_point() +
  labs(title = "this title is aligned with the plot and not the axis") + 
  theme(plot.title.position = "plot")

# alignment removed
ggMarginal(p)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions