visualization - adjust plot parameters in R while plotting regsubsets object in R (more room below x axis) -


I am trying to adjust the plotting parameters I usually have to do with par (mar = c ( 10, 4.1.4.1.2.1) To allow these labels to plot further under the X-axis, the variables are still running on the screen.

Is it The lipx package or the regsubsets object that I am plotting on does not recognize par (mar = c (10,4.1,4.1,2.1))

What am I trying to do Its a boiling example.

  Expected ('leapes') equals (Mar = C (10,4.1,4.1,2.1)) and & lt; - regsubsets (mpg ~ disp + hp # Label; artificially labeled ... my label this example made more than lt of dataset laboratories ##; - sapply (come $ xnames, $ datable + wt + qsec, data = mtcars, nbest = 2, nvmax = 5) Plots (leaps, scale = c ('adjr2'), labels = labs))  

This equation Roh ( plot.regsubsets () ) due to the function body of the mar setting. It overrides mar you set.

You can fix it by adding mar to plot.regsubsets () function and send it to par () < Call on line 3 of the / code> function body:

  plot.regsubsets & lt; -function (x, labels = obj $ xnames, main = null, scale = c ("bic", "cp", "adjr2", "r2"), col = gray (seq (0,0.9, length = 10) ), Mar = c (7,5,6,3) +0.1, ...) {obj & lt; -x lsum & lt; -summary (obj) par (march = march) nmodels & lt; -length (lsum $ RSQ) NP & LT; -obj $ np propscale & lt; -FALSE sscale & lt; -pmatch (scale [1], c ("bic", "cp", "adjr2", "r2"), nomatch = 0) if (sscale == 0) (stop paste ("Do not recognize scale =", Scale)) if (propscale) stop (paste ("proportional scaling possibilities only")) yscale & lt; Switch (sscale, lsum $ bic, lsum $ cp, lsum $ adjr2, lsum $ rsq) from top & lt; Switch (sscale, -1, -1,1,1) of index & lt; -order (yscale * up) for colors and Lt; - Log (ssKle, Yscale, YSCell, -log (Pmax (yscale, 0.0001)) - (Pmax (yscale, 0.0001)) log () image (z = t (ifelse (lsum $ which [index], colorscale [ Index], NA + max (colorscale) * 1.5), xaxt = "n", yaxt = "n", x = (1: np), y = 1: nmodels, xlab = "", ylab = scale [1 ], Col = col) laspar & lt; -par ("Las") on.exit (par (las = laspar)) is equal to (las = 2) axis (1, on = 1: np, label = label) axis (2, at = 1: nmodels, labels = Signif Yscale [index], 2)) (! Is.null (main)) title (main = main) box () invisible (null)}  

Comments