def twinx(ax=None):
 if (ax is None):
  ax = gca()
 ax1 = ax.twinx()
 return ax1

def twinx ( ax = None ) : if ( ax is None ) : ax = gca ( ) ax1 = ax . twinx ( ) return ax1
make a second axes overlay *ax* sharing the xaxis .