-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_data.r
More file actions
58 lines (39 loc) · 936 Bytes
/
Copy pathplot_data.r
File metadata and controls
58 lines (39 loc) · 936 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
plot(10,20)
plot (-70,-150)
plot(-39, 6)
# create a vector x
x <- c(2, 4, 6, 8)
plot(x)
# create a vector y
y <- c(13, 40, 46, 18)
plot(y)
# draw sequence of points
plot(10:50)
plot(-10:10)
plot(-10,20)
# Different parameters for type
# Value Description
# "p" Points Plot (Default)
# "l" Line Plot
# "b" Both Line and Points
# "s" Step Plot
# "n" No Plotting
# "h" Histogram-like Plot
# plot line
plot(1:10, type="l", lwd=2)
# plot both line and points
plot(1:10, type="b", lwd=2)
# step plot
plot(1:10, type="s", lwd=2)
# no plot
plot(1:10, type="n", lwd=2)
# Histogram like plot
plot(2:20, type="h", lwd=2)
# Add labels
# main - adds the title "Plot Sequence of Points"
# xlab - adds the label for x-axis
# ylab - add the label for y-axis
plot(1:5,
main="Plot Sequence of Points",
xlab="No of Experience(yrs)",
ylab="salary(lacs)")