使用此代码:
ggMarginal(p1, margins = "x", size = 2, type = "histogram",
col = "blue", fill = "orange")
我可以制作这种情节:
但是我想在直方图的y轴上显示百分比值的值,你能帮助我吗?
答案 0 :(得分:0)
你应该导入包(scales)
,看起来应该是这样的
...
library('scales')
ggMarginal(p1, margins = "x", size = 2, type = "histogram",
col = "blue", fill = "orange") + scale_y_continuous(labels=percent)