Question

I have a scatterplot with many variables, and need to control the color of only the points in the scatterplot, but to leave the lines as they are colored. I have

scatterplotMatrix(~y+x1+x2+x3+x4, data=dataset, cex=.5,col=rgb(0,100,0,50,maxColorValue=255))

The above code changes the color of both the points and the regression lines, which I don't want..

Any help please?

Thanks!

Was it helpful?

Solution

You don't tell us what package scatterplotMatrix is in.

If it is the one in the car package then it looks like the col argument will take 3 colors with the first 2 specifying the colors for lines and the 3rd for the points. So if you change your call to have a vector with 3 colors (with the 3rd being the value that you want the points to be) then it should work.

If a different function is being used then you need to tell us more.

Here is a quick example (since we don't have your data):

scatterplotMatrix( ~Sepal.Width+Sepal.Length+Petal.Width+Petal.Length,
 data=iris, col=c('purple','blue','black') )

The character strings that I used for colors can be replaced with calls to rgb.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top