forked from rdpeng/ExData_Plotting1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot3.R
More file actions
19 lines (19 loc) · 669 Bytes
/
plot3.R
File metadata and controls
19 lines (19 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## First check whether it has the file in the current dir.
if (!"load_data.R" %in% list.files()) {
setwd("~/Desktop/Online Coursera/Coursera-Exploratory-Data-Analysis/ExData_Plotting1/")
}
source("load_data.R")
png(filename = "plot3.png",
width = 480, height = 480,
units = "px", bg = "transparent")
plot(DateTime, Sub_metering_1,
type = "l",
col = "black",
xlab = "", ylab = "Energy sub metering")
lines(DateTime, Sub_metering_2, col = "red")
lines(DateTime, Sub_metering_3, col = "blue")
legend("topright",
col = c("black", "red", "blue"),
c("Sub_metering_1", "Sub_metering_2", "Sub_metering_3"),
lwd = 1)
dev.off()