Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 用Latex表达式覆盖ggplot轴标签_R_Ggplot2_Latex_Axis Labels - Fatal编程技术网

R 用Latex表达式覆盖ggplot轴标签

R 用Latex表达式覆盖ggplot轴标签,r,ggplot2,latex,axis-labels,R,Ggplot2,Latex,Axis Labels,如何使用通过计算/打印的latex表达式覆盖轴文本(连接到tix的轴的文本,而不是轴标题) 重命名轴文本的常用方法不起作用: MWE df <- data.frame(x=c("a","b"), y=c(1,2)) ggplot(df, aes(x, y))+ geom_point()+ scale_x_discrete(labels=c(TeX("$Test^{89}$"), TeX("$Oh_{i,j}^{9

如何使用通过计算/打印的latex表达式覆盖轴文本(连接到tix的轴的文本,而不是轴标题)

重命名轴文本的常用方法不起作用:

MWE

df <- data.frame(x=c("a","b"), y=c(1,2))
ggplot(df, aes(x, y))+
  geom_point()+
  scale_x_discrete(labels=c(TeX("$Test^{89}$"), TeX("$Oh_{i,j}^{99}$")))

df刚刚发现-它与。基本上,您需要围绕它包装
unname()

df <- data.frame(x=c("a","b"), y=c(1,2))
ggplot(df, aes(x, y))+
  geom_point()+
  scale_x_discrete(labels=unname(TeX(
    c("$Test^{89}$","$Oh_{i,j}^{99}$"))))
df