-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot2.R
More file actions
39 lines (28 loc) · 885 Bytes
/
plot2.R
File metadata and controls
39 lines (28 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# get Data
source("load_myData.R")
myData_TwoDaysPeriod <- load_myData()
# Plots Constants
PlotWidth <- 480
PlotHeight <- 480
PlotUnits <- "px"
PlotBg <- "white"
PlotFileName <- "./data/plot2.png"
MarginBottom <- 8
MarginLeft <- 8
MarginTop <- 7
MarginRight <- 6
PlotColsColor <- "red"
PlotTitle <- "Global Active Power"
PlotXLabel <- ""
PlotYLabel <- "Global Active Power (kilowatts)"
#Graphical Device is PNG
png(filename = PlotFileName , width = PlotWidth, height = PlotHeight, units = PlotUnits, bg = PlotBg)
# Graphical margins
par(mar = c(MarginBottom, MarginLeft, MarginTop, MarginRight))
# Graphic Plot
plot(myData_TwoDaysPeriod$DateTime, myData_TwoDaysPeriod$Global_active_power,
type="l",
xlab=PlotXLabel,
ylab=PlotYLabel)
# Close Graphical device
dev.off()