Make a second axes that shares the *x*-axis. The new axes will overlay *ax* (or the current axes if *ax* is *None*). The ticks for *ax2* will be placed on the right, and the *ax2* instance is returned. .. seealso:: :doc:`/gallery/subplots_axes_and_figures/two_scales`
(ax=None)
| 1283 | |
| 1284 | |
| 1285 | def twinx(ax=None): |
| 1286 | """ |
| 1287 | Make a second axes that shares the *x*-axis. The new axes will |
| 1288 | overlay *ax* (or the current axes if *ax* is *None*). The ticks |
| 1289 | for *ax2* will be placed on the right, and the *ax2* instance is |
| 1290 | returned. |
| 1291 | |
| 1292 | .. seealso:: |
| 1293 | |
| 1294 | :doc:`/gallery/subplots_axes_and_figures/two_scales` |
| 1295 | |
| 1296 | """ |
| 1297 | if ax is None: |
| 1298 | ax = gca() |
| 1299 | ax1 = ax.twinx() |
| 1300 | return ax1 |
| 1301 | |
| 1302 | |
| 1303 | def twiny(ax=None): |