本文介绍了如何在R的地块标签上写入每立方米的千分尺平方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在ggplot的plot label 中写入千分尺/立方米,当我添加m ^ 2时,出现错误。第一个表达式是可以的,但它缺少^ 2。我加入m ^ 2的尝试不起作用,因为我没有看到上标。


  1. ylab(表达式(paste(Surface area concentration(,mu,m / (表达式,表达式,表达式,表达式,表达式,表达式,表达式,表达式,表达式) (paste(Surface area concentration(,mu,,m ^ 2,/,m ^ 3,),sep =)))


谢谢

解决方案

一个报价问题:

pre $ c $ library $ g
qplot(mpg,wt,data = mtcars)+
表达式(表达式(paste(
表面积浓度(,
mu,m ^ 2,/,m ^ 3,
),sep =)) )


I would like to write micrometer square/cubic meter in my plot label in ggplot and I got an error when I add m^2. The first expression is ok but it's missing the ^2. My attempt to add m^2 did not work because I did not see the superscript.

  1. ylab (expression(paste("Surface area concentration (",mu,"m/",m^3,")", sep="")))

  2. ylab (expression(paste("Surface area concentration (",mu,",m^2,"/,m^3,")", sep="")))

Thank you

解决方案

That is just a quote problem:

library(ggplot2)
qplot(mpg, wt, data = mtcars) + 
ylab (expression(paste(
  "Surface area concentration (",
  mu, m^2, "/", m^3,
  ")", sep="")))

这篇关于如何在R的地块标签上写入每立方米的千分尺平方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 14:46