gravatar

fabiolima

Fábio de Lima

Recently Published

Plot multiple columns in the same graph R
# The file the column x is one colunm to all file # s<- read.table("merge.csv",sep=",",head=T) ##Loading packages library(ggplot2) #Library ggplot library(latex2exp) #symbols latex in plots graphics s<- melt(s,id.vars = "Onda") p <- ggplot(s, aes(Onda,value, col=variable)) + xlab(TeX('Wavenumber / $cm^{-1}$')) p <- p + geom_line() p <- p + scale_x_reverse() p <- p + ylab('intensity') P <- p + theme(axis.title = element_text(family = "Trebuchet MS", color="#666666", face="bold", size=14)) p <- p + theme(axis.text.x = element_text(face="bold", color="#993333", size=10,angle=0)) p <- p + theme(axis.text.y = element_text(face="bold", color="#993333", size=10, angle=0)) print(p) # visualize your plot #Save plot p <- p + ggsave("plot.png", width = 9, height = 10, dpi=300)