Skip to content

ggtitle height varies with descending letters #2288

Closed
@WHMan

Description

@WHMan

Hi there,

I just noticed that the height of a ggplot2 main title depends on the letters used. Although there is no difference in the title height (and therefore the dimensions of the plot itself) between titles with only typical sized letter (e.g. "arrr") or with ascenders (e.g. "brrr"), the title height increases with the inclusion of descenders (e.g. "prrr"). Although I understand that as a workaround I can use all-caps or readjust the plot height with ggplotGrob, I wonder whether I missed a parameter (within theme?) that could fixate the title height independent on the letters used.

library(ggplot2)
library(gridExtra)
grid.arrange(ggplot() + ggtitle("arrr"),
             ggplot() + ggtitle("brrr"),
             ggplot() + ggtitle("prrr"),
             nrow = 1)

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementthemes 💃wipwork in progress

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions