forked from rdpeng/ExData_Plotting1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot4.R
More file actions
16 lines (11 loc) · 710 Bytes
/
plot4.R
File metadata and controls
16 lines (11 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
png(filename='plot4.png',width=480, height=480)
par(mfrow=c(2,2))
with(d, plot(newt, Global_active_power, type='l',ylab='Global Active Power'))
with(d, plot(newt, Voltage, type='l',xlab='datetime', ylab='Voltage'))
with(d, plot(newt, Sub_metering_1, type='n',ylab='Engery sub metering'))
with(d, points(newt, Sub_metering_1, col='black', type='l'))
with(d, points(newt, Sub_metering_2, col='red', type='l'))
with(d, points(newt, Sub_metering_3, col='blue', type='l'))
legend('topright', c('Sub_metering_1', 'Sub_metering_2', 'Sub_metering_3'),lty=c(1,1,1), col=c("black", "red", "blue"), bty='n')
with(d, plot(newt, Global_reactive_power, type='l',xlab='datetime', ylab='Global_reactive_power'))
dev.off()