我正在用横条画一个图,包括双轴。你知道吗
我希望记号的颜色与条形图的颜色完全相同,也就是说,包括参数“alpha”。你知道吗
但是我不能给他们这个参数。你知道吗
有什么解决办法吗?你知道吗
下面是一段相关代码:
# Drawing the bar plot:
rects1 = ax1.bar(x_axis, y_values, bar_width, color='magenta', alpha = 0.4)
# Playing with color for the bars
ax1.set_ylabel('Charge value [nC]', color='magenta', alpha = 0.4)
# Get the ticks and copy color HERE DOES NOT WORK
for tl in ax1.get_yticklabels():
tl.set_color(color='magenta', alpha = 0.4)
回溯:
tl.set_color(color='magenta', alpha = 0.4)
TypeError: set_color() got an unexpected keyword argument 'alpha'
set_color
,顾名思义,只设置颜色。要设置alpha级别,请使用set_alpha
:相关问题 更多 >
编程相关推荐