How to resize regression lines in panel.abline in Lattice?

Ok, I was looking for a function that helps me resize my regression line in xyplot. I tried panel.abline(reg = coef, size = 2) , but it does not work.

Listen to 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 resize the regression line by simply setting geom_abline(size = 2)

I am still studying lattice and I don't know if there is a function for this or something else.

Any help is greatly appreciated.

+4
source share
1 answer

to try

 panel.abline(reg = coef, lwd = 2) 

(although lwd ("line width") is listed on the help page to understand this, you may have to familiarize yourself with the basic graphics that this specification mimics)

+9
source

Source: https://habr.com/ru/post/1399501/


All Articles