Skip to content

element_text size using vector #3492

Closed
@mpgerstl

Description

@mpgerstl

Hi,

When using a vector for axis text size in a flipped bar chart, the bars seems to be moved far outside the plot region, and also the text is shifted. I am using ggplot2 version 3.2.1.
I was able to produce the wished plot with ggplot2 version 3.1.1

library(tidyverse)
library(tibble)
ds <- mtcars %>%
  rownames_to_column() %>%
  select(car = rowname, mpg)

ds_size = rep(8, nrow(ds))
ds_size[10] <- 12

ds %>%
  ggplot(aes(x = car, y = mpg)) +
  coord_flip() +
  theme(axis.text.y = element_text(size = ds_size))

Thank you

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