ggplot scale_x_continuous with symbol: make bold

前端 未结 2 1109
小蘑菇
小蘑菇 2020-12-19 08:01

Here is the issue: I am using ggplot to to make a graph in which the x axis ranges from -90 to 90 degrees. I have successfully used a function to add degree sym

2条回答
  •  轮回少年
    2020-12-19 08:38

    I'm reusing the function taken from a similar question, which only requires a little adjustment.

    make_labels <- function(value) {
      x <- as.character(value)
      do.call(expression, lapply(x, function(y) bquote(bold(.(y))^degree)))
    }
    

    Now, in your ggplot call instead of add_degree use labels = make_labels and you'll get

提交回复
热议问题