我正在使用ggplot通过从excel文件中读取数据来生成图形。在Excel文件中有一些希腊字母,如Theta。因此,当我绘制图表时,除了希腊字母被取代之外,每件事情都能正常运作。传说中的符号。
以下是我的ggplot代码。
km = read.csv("LN3T0_Zab_ZabCTALL.csv",T)
km <- transform(km, Protocols= reorder(Protocols, order(Order, decreasing = F)))
plot1 <- ggplot(data=km , aes(x=Write.Ratio, y=Latency, group=Protocols, colour = Protocols, shape=Protocols)) +
geom_errorbar(aes(ymin=Latency-Error, ymax=Latency+Error), width=2.0, colour="black") +
geom_line(size=1.2) +
geom_point(size=3.2)
plot1 <- plot1 + scale_y_continuous(breaks= seq(0,80,10), limits = c(0,80)) +
labs(x="Write Ratio") +
scale_x_continuous(breaks = c(10,20,30,40,50,60,70,80,90,100)) +
labs(y="Latency (ms)")
plot1 <- plot1 + scale_colour_manual(values=c("#00ff00","#0000ff","#00ffff","#bf00ff","#ff00bf"))
plot1 <- plot1 + theme_bw() +
theme(legend.position="bottom") +
labs(fill="", colour=" ", shape=" ") +
theme(text = element_text(size=18)) +
guides(fill = guide_legend(keywidth = 0.8, keyheight = 0.01))+
scale_shape_manual(values=c(16, 15, 18, 19, 20))
plot1
如何在使用ggplot生成的图表中显示希腊字母(用Excel文件编写)?
任何帮助?