我想知道如何不根据计数来缩放geom_hex,而是通过变量和热缩放它?我在实际模型中也存在过拟合,想知道如何消除它?下面是一个示例:
''' ggplot(data = diamonds)+ geom_hex(mapping = aes(x = x, y = price, fill = depth, bins = 25))+ scale_fill_continuous(type = "viridis") '''
谢谢!
bxgwgixi1#
我想这就可以了,假设你想根据depth的平均值给六边形上色...
depth
ggplot(diamonds, aes(x = x, y = price, z = depth)) + stat_summary_hex(fun = mean, bins = 25) + scale_fill_continuous(type = "viridis")
1条答案
按热度按时间bxgwgixi1#
我想这就可以了,假设你想根据
depth
的平均值给六边形上色...