library('ggplot2')
spectrum <- data.frame(
mz = c(133.0284,134.0383,178.0274,193.0504),
intensity =c(21.37909,71.00197,33.54125,11.33192))
ggplot(spectrum, aes(x = mz, y = intensity)) +
geom_point(size = 0)+
geom_segment(aes(x = mz, y = 0,xend = mz, yend = intensity), size = 0.8)+
labs(y="Relative Intensity",x="m/z")+
ggtitle("Ferulic Acid")
Ferulic Acid