I'd like to use three bars with three y-axes in matplotlib python.
I use two bars with two y-axes, everything is ok Ref. ,
but once added the third one is not good.
I'd like to add the third scale using black color.
Please your help.
width = 0.25
fig, ax1 = plt.subplots()
ind = np.arange(len(r2_score1))
print 'r2_score1', r2_score1
rects1 = ax1.bar(ind, r2_score1, width, color = 'b')
ax1.set_xticks(ind+width)
ax1.set_xticklabels(names, fontsize=14)
ax1.set_ylabel('r2_score', color='b')
for tl in ax1.get_yticklabels():
tl.set_color('b')
ax2 = ax1.twinx()
rects2 = ax2.bar(ind + width, time_model, width, color = 'r')
ax2.set_ylabel('Time (s)', color='r')
for tl in ax2.get_yticklabels():
tl.set_color('r')
ax3 = ax2.twinx()
rects3 = ax3.bar(ind + width+ width, rmse, width, color = 'k')
ax3.set_ylabel('rmse', color='k')
for tl in ax3.get_yticklabels():
tl.set_color('k')