ax2.plot(x, y2, color='g', label='bVal')
ax2.grid(ls='--', color='black')
h1, l1 = ax1.get_legend_handles_labels()
h2, l2 = ax2.get_legend_handles_labels()
ax1.legend(h1 + h2, l1 + l2, loc=2)
Single legend for multiple axes