title: How to create grouped bar chart with secondary y-axis on matplotlib python
body: <p>I just started to learn and work with python. I am facing trouble when I am trying to create a grouped bar chart with the secondary y-axis.</p>
  <p>Here are the code for just now and the result</p>
  <pre><code>import matplotlib.pyplot as plt
  fig, graph1=plt.subplots(figsize=(20,5))
  graph2 = graph1.twinx()
  graph1.bar(data_trans3['ITEM_NAME'],data_trans3['nett_profit'],width=0.3)
  graph2.bar(data_trans3['ITEM_NAME'],data_trans3['QTY'],width=0.3)
  </code></pre>
  <p><img src="https://i.stack.imgur.com/NYrJc.png" alt="enter image description here" /></p>
  <p>What should I do to create the grouped bar chart with the <strong>x-axis</strong> as <strong>item_name</strong> and <strong>y-primary axis</strong> as the <strong>nett_profit</strong> while the <strong>y-secondary axis</strong> as the <strong>QTY</strong>.</p>
  <p>I am sure that the code above is in the form of a simple bar chart.</p>