I hope I do not misunderstand your question and the answer helps: You need to replace your ax1.plot(x,r1) and ax2.plot(x,m2) with ax1.bar(x ... ... <看更多>
To this end, Matplotlib has the concept of subplots: groups of smaller axes that can exist together within a single figure. These subplots might be insets, ... ... <看更多>