title: Subplot secondary axis - Python, matplotlib
body: <p>I have a dataframe called conversionRate like this:</p>
  
  <pre>
  
            | State| Apps  | Loans| conversionratio|
  2013-01-01  IL      1165    152   13.047210
  2013-01-01  NJ      2210    756   34.208145
  2013-01-01  TX      1454    73    5.020633
  2013-02-01  CA      2265    400   17.660044
  2013-02-01  IL      1073    168   15.657036
  2013-02-01  NJ      2036    739   36.296660
  2013-02-01  TX      1370    63    4.598540
  2013-03-01  CA      2545    548   21.532417
  2013-03-01  IL      1108    172   15.523466
  </pre>
  
  <p>I intend to plot the number of apps and number of loans in the primary Y axis and the Conversion Ratio in the secondary axis for each state.</p>
  
  <p>I tried the below code:</p>
  
  <pre><code>import math
  rows =int(math.ceil(len(pd.Series.unique(conversionRate['State']))/2))
      fig, axes = plt.subplots(nrows=rows, ncols=2, figsize=(10, 10),sharex=True, sharey=False)
      columnCounter = itertools.cycle([0,1])
      rowCounter1    = 0
      for element in pd.Series.unique(conversionRate['State']):
          rowCounter  = (rowCounter1)//2
          rowCounter1 = (rowCounter1+1)
          subSample = conversionRate[conversionRate['State']==element]
          axis=axes[rowCounter,next(columnCounter)]
          #ax2 = axis.twinx()
          subSample.plot(y=['Loans', 'Apps'],secondary_y=['conversionratio'],\
                                ax=axis)
  </code></pre>
  
  <p>I end up with a figure like the below: </p>
  
  <p><a href="https://i.stack.imgur.com/a9jt1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a9jt1.png" alt="enter image description here"></a></p>
  
  <p>The question is how do I get the secondary axis line to show? If I try the below (per the manual setting secondary_y in plot() should selectively plot those columns in the secondary axis), I see only the line I plot on the secondary axis. There must be something simple and obvious I am missing. I can't figure out what it is! Can any guru please help? </p>
  
  <pre><code>subSample.plot(secondary_y=['conversionratio'],ax=axis)
  </code></pre>