首页 > 解决方案 > 为什么 Matplotlib/seaborn alpha 参数不采用列表或数组?

问题描述

在 matplotlib 和 seaborn 中,大小、颜色、样式等参数接受列表/熊猫列。 alpha 不将 list/array/column 作为参数是否有任何具体原因。虽然可以通过发送预先映射的颜色来解决问题,但是仅仅能够做这样的事情会好得多

sns.scatterplot(x='SepalLengthCm',y='SepalWidthCm',data=df,alpha='Species')  

标签: pythonmatplotlibseaborn

解决方案


推荐阅读