首页 > 解决方案 > 如何减少 ggplot2 bquote 标签标题中 unicode 字符之间的空格?

问题描述

我正在尝试并未能在 ggplot2 标签 bquote 中获得正确的间距。具体来说,在 unicode 字符 \U00B7 和引号的其余部分之间。如何减少它以使 unicode 字符与其余字母相邻?

请参阅下面的reprex,标签没有意​​义,但说明了这一点。

library(tidyverse)

ggplot(data = iris) + 
  geom_point(aes(x = Sepal.Length, y = Sepal.Width)) + 
  ylab(bquote('Sepal.Width '~'(mg'~'\U00B7 N'[2]*~"\U00B7"~h^-1*~"\U00B7"~g^-1*')'))

reprex 包于 2021-06-23 创建(v0.3.0)

标签: rggplot2legend

解决方案


推荐阅读