符号lambda(λ)在导出图像中以r的pdf出口时不会显示?
我使用ggplot2在r中创建了一个图,并使用注释我在文本中包括了一个lambda(λ)符号。但是,当我确实出口时;另存为PDF,PDF映像没有显示lambda,而只是显示了一个“ ..”,我附上了下面的样子的示例:
这是我使用的代码:
dna.b.bae.coi <- data.frame(hours=c(1,2,24,48,96,168,672), copies=c(39,46,13,1,0,0,0))
nlsLM(copies ~ a*exp(b*hours), data=dna.b.bae.coi, start=list(a=39,b=-0.16507))
nlsplot(dna.b.bae.coi, model=6, start=c(a=45.97176,b=-0.05464))
a1<- ggplot(dna.b.bae.coi, aes(x=hours, y=copies)) + geom_point() + stat_smooth(method = 'nls', method.args = list(start = c(a=45.97176,b=-0.05464)), formula = y~a*exp(b*x), se=FALSE, linetype=2, colour="yellow") + theme_classic() + xlab("") + ylab("") +
annotate("text", x = 300, y = 46, label = "COI eDNA\nλ = -0.0546", color = "black", hjust = 0, vjust = 1) +
ggtitle(expression(~italic("Baetidae")))
a1
我不知道为什么会发生这种情况。有没有办法解决此问题,以便当我保存为PDF时,λ实际上出现在我的数字中?
提前致谢!
I created a figure in R using ggplot2, and using annotate I included a lambda (λ) symbol in the text. However, when I do Export > Save as PDF, the PDF image does not show the lambda and instead just shows a ".." I have attached an example of what this looks like below:
This is the code I used:
dna.b.bae.coi <- data.frame(hours=c(1,2,24,48,96,168,672), copies=c(39,46,13,1,0,0,0))
nlsLM(copies ~ a*exp(b*hours), data=dna.b.bae.coi, start=list(a=39,b=-0.16507))
nlsplot(dna.b.bae.coi, model=6, start=c(a=45.97176,b=-0.05464))
a1<- ggplot(dna.b.bae.coi, aes(x=hours, y=copies)) + geom_point() + stat_smooth(method = 'nls', method.args = list(start = c(a=45.97176,b=-0.05464)), formula = y~a*exp(b*x), se=FALSE, linetype=2, colour="yellow") + theme_classic() + xlab("") + ylab("") +
annotate("text", x = 300, y = 46, label = "COI eDNA\nλ = -0.0546", color = "black", hjust = 0, vjust = 1) +
ggtitle(expression(~italic("Baetidae")))
a1
I am not sure why this is happening. Is there a way around this so that the λ actually shows up in my Figure when I save as PDF?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与
ggsave
:
您可以使用 tikzdevice ,它将您的情节转换为乳胶。
This works with
ggsave
:EDIT With
tikzDevice
:To get a pdf, you can use tikzDevice, which converts your plot in LaTeX.