Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.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 ggplot>;mac os上的svg文件_R_Svg_Ggplot2 - Fatal编程技术网

R ggplot>;mac os上的svg文件

R ggplot>;mac os上的svg文件,r,svg,ggplot2,R,Svg,Ggplot2,我在Mac上将GGPlot导出为svg文件时遇到了一个奇怪的问题。有趣的是,为.pdf编写准确的代码会起作用,TIFF也会起作用 这些都不起作用- AggregateWI2 = summarySE(AggregateWI1, measurevar="WI", groupvars=c("Cond","Iso","within")) ggplot(AggregateWI2, aes(x=Cond, y=WI, group=within)) + geom_bar(position=

我在Mac上将GGPlot导出为svg文件时遇到了一个奇怪的问题。有趣的是,为.pdf编写准确的代码会起作用,TIFF也会起作用

这些都不起作用-

    AggregateWI2 = summarySE(AggregateWI1, measurevar="WI", groupvars=c("Cond","Iso","within"))
      ggplot(AggregateWI2, aes(x=Cond, y=WI, group=within)) +
geom_bar(position=position_dodge(), stat="identity", fill="#999999", colour="black") +
facet_grid(Iso ~ ., labeller=iso_labeller) + theme(strip.text.y = element_text(size=18, face="italic"                                                                                                                                           )) + 
geom_errorbar(aes(ymin=WI-se, ymax=WI+se), 
              width=.2, position=position_dodge(.9)) +
scale_x_discrete(name="Surgical Condition") + 
scale_y_continuous(name="Water Intake (ml)") + theme(axis.text.x=element_text(size=18),
    axis.text.y=element_text(size=18),
    axis.title.x=element_text(size=22),
    axis.title.y=element_text(size=22),
    strip.text.y=element_text(size=18))

    ggsave("waterintake.svg")
这确实有效-

`pdf("EEstudy2.pdf")
ggplot(height = 100, width = 100, EEdata1, aes(x = COND, y = EE)) + geom_bar(position = position_dodge(), 
stat = "identity", fill = "#999999", colour = "black", aes(width=0.4)) + geom_errorbar(aes(ymin = EE - se, ymax = EE + se), width = 0.15, position = position_dodge(0.9)) + 
scale_x_discrete(name = "Isoflurane") + scale_y_continuous(name = "Emetic Episodes") +
theme(axis.text.x=element_text(size=18),
    axis.text.y=element_text(size=18),
    axis.title.x=element_text(size=22),
    axis.title.y=element_text(size=22),
    strip.text.y=element_text(size=18))
    dev.off()
这也不起作用-

svg(file = "boxplotFG.svg", width = 7, height = 7)
ggplot(FGdata, aes(Cond, DMN_NTS))+geom_boxplot()  +xlab("Surgical Condition") + ylab("Gray Level DMN:NTS") + geom_jitter(position=position_jitter(w=0.1, h=0.1), size=3)+ theme(axis.text.x=element_text(size=18),
    axis.text.y=element_text(size=18),
    axis.title.x=element_text(size=22),
    axis.title.y=element_text(size=22),
    strip.text.y=element_text(size=18))
dev.off()

不起作用怎么办?症状是什么?面临什么问题?它是如何工作的?有时我会遇到一些类型的“石英错误”,否则它会运行,但不会创建任何svg文件。我试着在整个电脑里搜索这个文件。