diff --git a/Plot1.R b/Plot1.R new file mode 100644 index 00000000000..699b80d6a1b --- /dev/null +++ b/Plot1.R @@ -0,0 +1,5 @@ + +png(filename = "Plot1.png", width = 480, height = 480) +hist(Global_active_power,col = "red", xlab = "Global active power (kilowwatts)", main = "Global Active Power") +dev.off() +rm(epc) diff --git a/Plot1.png b/Plot1.png new file mode 100644 index 00000000000..03cdda25802 Binary files /dev/null and b/Plot1.png differ diff --git a/Plot2.R b/Plot2.R new file mode 100644 index 00000000000..b1d3d771d47 --- /dev/null +++ b/Plot2.R @@ -0,0 +1,7 @@ + +source("LoadData.R") +png(filename = "Plot2.png", width = 480, height = 480) +plot(Global_active_power, type = "l", xlab = "", ylab = "Global Active Power (kilowatts)", xaxt = "n") +axis(side = 1, at = seq(1,2880, by = 1439), labels = c("Thu", "Fri", "Sat")) +dev.off() +rm(epc) diff --git a/Plot2.png b/Plot2.png new file mode 100644 index 00000000000..08381f8befb Binary files /dev/null and b/Plot2.png differ diff --git a/Plot3.R b/Plot3.R new file mode 100644 index 00000000000..02173a1916c --- /dev/null +++ b/Plot3.R @@ -0,0 +1,10 @@ + +source("LoadData.R") +png(filename = "Plot3.png", width = 480, height = 480) +plot(Sub_metering_1, type = "l", xlab = "", ylab = "Global Active Power (kilowatts)", xaxt = "n") +lines(Sub_metering_2, col = "red") +lines(Sub_metering_3, col = "blue") +legend("topright", col = c("black", "red", "blue"), c("Sub_metering_1", "Sub_metering_2", "Sub_metering_3"), lwd = 1) +axis(side = 1, at = seq(1,2880, by = 1439), labels = c("Thu", "Fri", "Sat")) +dev.off() +rm(epc) diff --git a/Plot3.png b/Plot3.png new file mode 100644 index 00000000000..ead5fec8ecf Binary files /dev/null and b/Plot3.png differ diff --git a/Plot4.R b/Plot4.R new file mode 100644 index 00000000000..419c9e416c7 --- /dev/null +++ b/Plot4.R @@ -0,0 +1,17 @@ + +source("LoadData.R") +png(filename = "Plot4.png", width = 480, height = 480) +par(mfrow = c(2,2)) +plot(Global_active_power, type = "l", xlab = "", ylab = "Global Active Power (kilowatts)", xaxt = "n") +axis(side = 1, at = seq(1,2880, by = 1439), labels = c("Thu", "Fri", "Sat")) +plot(Voltage, type = "l", xlab = "datetime", xaxt = "n", ylab = "Voltage") +axis(side = 1, at = seq(1,2880, by = 1439), labels = c("Thu", "Fri", "Sat")) +plot(Sub_metering_1, type = "l", xlab = "", ylab = "Global Active Power (kilowatts)", xaxt = "n") +lines(Sub_metering_2, col = "red") +lines(Sub_metering_3, col = "blue") +legend("topright", bty = "n", col = c("black", "red", "blue"), c("Sub_metering_1", "Sub_metering_2", "Sub_metering_3"), lwd = 1) +axis(side = 1, at = seq(1,2880, by = 1439), labels = c("Thu", "Fri", "Sat")) +plot(Global_reactive_power, type = "l", xlab = "datetime", xaxt = "n") +axis(side = 1, at = seq(1,2880, by = 1439), labels = c("Thu", "Fri", "Sat")) +dev.off() +rm(epc) diff --git a/Plot4.png b/Plot4.png new file mode 100644 index 00000000000..143dc8a8ac7 Binary files /dev/null and b/Plot4.png differ