Return an axes in the same location as this one but whose y axis is on the right. This is an alias and more intuitive name for twinx, which generates two y axes with a shared (“twin”) x axes.


label, locator, formatter, ticks, ticklabels, minorlocator, minorticks, tickminor, ticklen, tickrange, tickdir, ticklabeldir, tickrotation, bounds, margin, color, linewidth, grid, gridminor, gridcolor, locator_kw, formatter_kw, minorlocator_kw, label_kw (optional) – Prepended with 'y' and passed to Axes.format.


This function enforces the following settngs.

  • Places the old y axis on the left and the new y axis on the right.

  • Makes the old right spine invisible and the new left, bottom, and top spines invisible.

  • Adjusts the y axis tick, tick label, and axis label positions according to the visible spine positions.

  • Locks the old and new x axis limits and scales, and makes the new x axis labels invisible.