簡體   English   中英

R:刪除上軸標題基本圖

[英]R: Remove top axis title base plot

我想基於plotmo軟件包刪除或重命名以下圖的“上軸標題”。 這是一個簡短的可復制示例:

library(glmnet)
library(plotmo)
data(mtcars)

fit <- glmnet(x=as.matrix(mtcars[,-1]), y=as.matrix(mtcars[,1]))
plot_glmnet(fit)

結果是:

在此處輸入圖片說明

看起來該圖是由基本圖函數制成的。 可能有人知道更改或刪除頂軸標題的方法

我可以實現您想要的唯一方法是編輯源代碼。

plot_glmet.edited<- plot_glmnet ## copy the function
as.list(body(plot_glmet.edited)) ## print the lines of the function

目前該代碼將不會打印標簽,請將NA替換為您想要用作標題的任何字符串

    body(plot_glmet.edited)[[33]] <- substitute(
         mtext(NA, side = 3, line = 1.5, cex = par("cex") * par("cex.lab")))

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM