Skip to content

Commit

Permalink
plot3
Browse files Browse the repository at this point in the history
  • Loading branch information
icases committed Jan 9, 2015
1 parent 515337c commit 3abc20f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plot3.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
temp <- tempfile()
download.file('http://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip',temp)
all_data<-read.csv(unzip(temp),sep = ";",header = T,quote = "",na.strings='?')
unlink(temp)
my_data<-subset(all_data,Date=='1/2/2007' | Date=='2/2/2007')
my_data$dt<-strptime(paste(my_data$Date,my_data$Time),"%d/%m/%Y %T")
png('plot3.png',bg = "transparent")
plot(my_data$dt,my_data$Sub_metering_1,ylab='Energy Submetering',xlab='',t='n')
lines(my_data$dt,my_data$Sub_metering_1,col='black')
lines(my_data$dt,my_data$Sub_metering_2,col='red')
lines(my_data$dt,my_data$Sub_metering_3,col='blue')
legend('topright',col=c("black","red","blue"),legend = c("Sub_metering_1","Sub_metering_2","Sub_metering_3"),lwd=1)
dev.off()
Binary file added plot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3abc20f

Please sign in to comment.