pbreheny / visreg

Visualization of regression functions
http://pbreheny.github.io/visreg/
61 stars 18 forks source link

visreg ignores strip.names if gg=TRUE in an overlay=TRUE plot #104

Closed tbates closed 1 year ago

tbates commented 1 year ago

visreg() should use strip.names to label levels in the legend of an overlay=TRUE plot This works in lattice output, but strip.names is ignored when gg=TRUE

Getting the legend re-labelled is complex post-hoc for the user...

m1 = lm(Ozone ~ Solar.R + Wind * Temp, data=airquality)
visreg(m1, "Temp", by="Wind", overlay=TRUE, strip.names=c("Low C", "Mid C", "High C"))

gg=TRUE version ignores strip.names

image

lattice version uses the strip.names:

image
pbreheny commented 1 year ago

Thanks for pointing this out and providing a reproducible example! This is fixed now in version 2.7.0.4.