从 r 中的树状图中删除 x 轴标签

标签 r plot hclust

我使用 xlab=""来抑制 x-label 但仍然在我的树状图中得到一个“sub-x-label”。如何删除它并删除树状图下的任何额外空间?

require(graphics)

hc <- hclust(dist(USArrests), "ave")
plot(hc,xlab="")

enter image description here

最佳答案

要删除副标题,请使用以下命令:

plot(hc, xlab="", sub="")

移除底部边距(详见 ?par):
par(mar=c(0, 4, 4, 2)) # c(bottom, left, top, right)
plot(hc, xlab="", sub="")

关于从 r 中的树状图中删除 x 轴标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12463062/

相关文章:

r - 操作 R 中的 cutree 对象以分割原始数据帧

r - 在地理空间分析中将多多边形转变为单点

python - 这里涉及什么概念? Python 和 R 中的示例。

r - R绘图栅格颜色方案不完整

r - R中的直方图函数-打破参数不起作用

r - R中plot函数如何查找regsubsets?

R将树状图切割成最小尺寸的组

r - 实三次多项式的最快数值解?

r - 查找逻辑矩阵的每一行是否至少有一个 TRUE

r - hclust 大小限制?