How to change font size in plot of cross-validation result from cvTools package in R? -
i try manipulate size of fonts (title , axis labels, especially) in plot of cross-validation result cvtools
package in r
. afraid not work:
library(cvtools) data(coleman) set.seed(1234) # split n observations k groups used (repeated) k-fold cross-validation folds <- cvfolds(nrow(coleman), k = 5, r = 50) # perform cross-validation ls regression model fitlm <- lm(y ~ ., data = coleman) cvfitlm <- cvlm(fitlm, cost = rtmspe, folds = folds, trim = 0.1) # perform cross-validation mm regression model fitlmrob <- lmrob(y ~ ., data = coleman, k.max = 500) cvfitlmrob <- cvlmrob(fitlmrob, cost = rtmspe, folds = folds, trim = 0.1) # combine results 1 object cvfits <- cvselect(ls = cvfitlm, mm = cvfitlmrob)
the 2 lines below differ in plot points size, there no change in title font size / labels font size.
# plot combined results plot(cvfits, main = "foo_title") plot(cvfits, main = "foo_title", cex = 0.5, cex.main = 0.5, cex.lab = 0.5)
what miss here?
base graphics par
settings don't work lattice , other grid graphics. plot methods cvtools
use lattice graphics. here ways change various font sizes in plot:
plot(cvfits, cex=0.5, # point markers main = list("foo_title", cex = 1), # title xlab=list(cex=0.75), ylab=list(cex=0.75), # axis titles scales=list(x=list(cex=0.75), y=list(cex=0.75))) # axis tick labels
Comments
Post a Comment