R ggplot中的粗体轴标签
使用下面的代码,我可以得到粗体的y轴标签,但不能得到x轴。只有在使用R ggplot中的粗体轴标签,r,ggplot2,R,Ggplot2,使用下面的代码,我可以得到粗体的y轴标签,但不能得到x轴。只有在使用math\u format()时,才会出现输出问题。奇怪的是,角度、颜色和大小等其他方面可以更改,但字体的面不能更改 library(ggplot2) library(scales) a <- ggplot(msleep, aes(bodywt, brainwt)) + geom_point(na.rm = TRUE) + scale_x_log10( breaks = trans_breaks("
math\u format()
时,才会出现输出问题。奇怪的是,角度
、颜色
和大小
等其他方面可以更改,但字体的面
不能更改
library(ggplot2)
library(scales)
a <- ggplot(msleep, aes(bodywt, brainwt)) +
geom_point(na.rm = TRUE) +
scale_x_log10(
breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
scale_y_log10()+
theme(axis.text.x = element_text(size=10, face="bold", color = "black"),
axis.text.y = element_text(size=10, face="bold", color = "black"))
a
库(ggplot2)
图书馆(比例尺)
a通过其工作功能直接复制/粘贴
a <- ggplot(msleep, aes(bodywt, brainwt)) +
geom_point(na.rm = TRUE) +
scale_x_log10(
breaks = trans_breaks("log10", function(x) 10^x),
labels = function(lab) {
do.call(
expression,
lapply(paste(lab), function(x) bquote(bold("10"^.(x))))
)
}) +
scale_y_log10()+
theme(axis.text.x = element_text(size=10, face="bold", color = "black"),
axis.text.y = element_text(size=10, face="bold", color = "black"))
a
a你好,我发现你的问题很有趣。我没有答案,但也许post会帮助你