A line graph has a line that connects all the points in a diagram. To create a line, use the Result: The line color is black by default. To change the color, use the Result: To change the width of the line, use the Result: The line is solid by default. Use the For example, Result: Available parameter values for To display more than one line in a graph, use the Result:Line Graphs
function and add the plot(>
parameter with a value of type
:
"l"
Example
Line Color
parameter:
col
Example
Line Width
parameter (lwd
is default, while 1
means 50% smaller, and
0.5
means 100% larger>2
:
Example
Line Styles
parameter with a value from
0 to 6 to specify the line format.
lty
will display a dotted line instead of a solid line:
lty=3
Example
:
lty
Multiple Lines
function together with the
plot(>
function:
lines(>
Example
line2 <- c(2,5,7,8,9,10>
plot(line1,
type = "l", col = "blue">
lines(line2, type="l", col = "red">