Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
How to change the color of line in xyplot in R?
To change the color of line in xyplot, we can use col argument.
For example, if we have two vectors say X and Y and we want to create a red colored xyplot between X and Y then we can use the following command −
xyplot(x~y,type="l", col="red")
Check out the below example to understand how it works.
Example
To change the color of line in xyplot, use the code given below −
set.seed(123) library(lattice) xyplot(1:5~rpois(5,5),type="l",col="blue")
Output
If you execute the above given code, it generates the following output −

Advertisements
