You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将ggparcoord的Y轴刻度设置为(1,10,100,1000)?

解决ggparcoord设置Y轴自定义刻度的问题

要将Y轴刻度设置为(1,10,100,1000),你可以在生成的图表对象后添加scale_y_continuous()函数,手动指定刻度点和标签:

p <- ggparcoord(dt1, columns = c(108,111), groupColumn = 155, order = "anyClass", scale = "globalminmax", showPoints = TRUE, 
           alphaLines = 0.3) +
  scale_y_continuous(breaks = c(1, 10, 100, 1000), labels = c("1", "10", "100", "1000"))

补充说明

  • breaks参数用于定义Y轴上要显示的刻度位置
  • labels参数对应刻度的显示文本(这里和刻度值一致,可按需调整格式)
  • 如果你的数据范围超出1-1000,可添加limits = c(1, 1000)来限定Y轴范围,确保所有目标刻度都能正常显示:
p <- ggparcoord(dt1, columns = c(108,111), groupColumn = 155, order = "anyClass", scale = "globalminmax", showPoints = TRUE, 
           alphaLines = 0.3) +
  scale_y_continuous(breaks = c(1, 10, 100, 1000), 
                     labels = c("1", "10", "100", "1000"),
                     limits = c(1, 1000))

内容的提问来源于stack exchange,提问作者Sajin Kang

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 10:27:24