-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot1.R
More file actions
36 lines (24 loc) · 829 Bytes
/
plot1.R
File metadata and controls
36 lines (24 loc) · 829 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
# get Data
source("load_myData.R")
myData_TwoDaysPeriod <- load_myData()
# Plots Constants
PlotWidth <- 480
PlotHeight <- 480
PlotUnits <- "px"
PlotBg <- "white"
PlotFileName <- "./data/plot1.png"
MarginBottom <- 8
MarginLeft <- 8
MarginTop <- 7
MarginRight <- 6
PlotColsColor <- "red"
PlotTitle <- "Global Active Power"
PlotXLabel <- "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
hist(myData_TwoDaysPeriod$Global_active_power, col = PlotColsColor, main = PlotTitle, xlab = PlotXLabel)
# Close Graphical device
dev.off()