I am trying to plot matplotlib bar plot with one y-axis on the left and another y on the right with a common x-axis.The range column is on the x-axis. Perc column is on left y-axis and the count column is on the right y-axis. Please advise how to proceed.
Sample data is here - SampleFileHere
import numpy as np import pandas as pd import seaborn as sbn import matplotlib.pyplot as plt fig = plt.figure() ax = td['perc'].plot(kind="bar", alpha=0.7) plt.xticks(td['ranges'].tolist()) ax2 = ax.twinx() ax2.plot(ax.get_xticks(),td['count'],marker='o', c='navy', linewidth=4) I get the below error .
<ipython-input-24-c1d398c0d012> in <module>() 7 fig = plt.figure() 8 ax = td['perc'].plot(kind="bar", alpha=0.7) ----> 9 plt.xticks(td['ranges'].tolist()) 10 ax2 = ax.twinx() 11 ax2.plot(ax.get_xticks(),td['count'],marker='o', c='navy', linewidth=4) 
