【发布时间】:2017-01-11 18:02:05
【问题描述】:
我希望我的 y 轴刻度标签在刻度值为正时为绿色,在刻度值为负时为红色。
考虑以下系列和情节
np.random.seed([3,1415])
pd.Series(np.random.randn(100)).add(.1).cumsum().plot()
我需要[2, 4, 6, 8] 为绿色,[-2, -4, -6, -8] 为红色。
【问题讨论】:
-
你想要的是this吗?
-
@MaxU 否,格式化整个轴。我想要具有不同颜色的单个刻度标签。至少我是这么解释的。
标签: python pandas matplotlib