Ok, I've been looking for a function that helps me change the size of my regression line in xyplot. I tried panel.abline(reg = coef, size = 2)
but it doesn't work.
Hear is my code,
Plot.col <- brewer.pal(8,"Set1")[8][cut(Std.Change, c(-2.5,2.5), label = FALSE)]
Plot.ord <- rev(order(Std.Change))
coef <- coef(lm(Std.ModernC ~ Std.Change, data = Std.DataReg))
xyplot(Std.ModernC ~ Std.Change, data = Std.DataReg[Plot.ord, ], type = c("p", "g"), col = "blue",pch = 21, fill = Plot.col[Plot.ord], cex = 1.3,panel = function(...) {
panel.xyplot(...)
panel.abline(reg = coef, col = "blue")})
In ggplot, it is very easy to change for the size of regression line, by just setting geom_abline(size = 2)
I'm still learning lattice, and I don't know if there's a function for that, or whatsoever.
Any help is much appreciated.
try
panel.abline(reg = coef, lwd = 2)
(although lwd
("line width") is listed in the help page, in order to figure this out you would probably have to be familiar with base graphics, which this specification mimics)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With