Skip to content

Instantly share code, notes, and snippets.

@Protonk
Created March 24, 2011 19:53
Show Gist options
  • Select an option

  • Save Protonk/885733 to your computer and use it in GitHub Desktop.

Select an option

Save Protonk/885733 to your computer and use it in GitHub Desktop.
simple plot for radiation data
rad<-read.csv(file="~/Downloads/radtext.csv",as.is=TRUE)
radplot<- ggplot(data=rad,aes(x=1:619,y=cumsum(microSv))) + geom_line(size=I(1),linetype=I(2)) + scale_y_log10(name="microSieverts") + scale_x_continuous(labels=c(rad$time[seq(from=100,to=600,by=100)]),breaks=c(seq(from=100,to=600,by=100)),name='')
radplot<- radplot + geom_line(aes(x=1:619,y=microSv),colour="blue") + geom_hline(aes(yintercept=50000),colour="red")
radplot<- radplot + annotate(geom="text",x=575,y=35000,label="Yearly Limit",colour="red") + annotate(geom="text",x=575,y=1000,label="Hourly Dose",colour="blue") + annotate(geom="text",x=575,y=200000,label="Cumulative")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment