|
1 | 1 | from matplotview._view_axes import view_wrapper
|
2 | 2 |
|
3 | 3 | def view(axes, axes_to_view, image_interpolation="nearest"):
|
| 4 | + """ |
| 5 | + Convert an axes into a view of another axes, displaying the contents of |
| 6 | + the second axes. |
| 7 | +
|
| 8 | + Parameters |
| 9 | + ---------- |
| 10 | + axes: Axes |
| 11 | + The axes to turn into a view of another axes. |
| 12 | +
|
| 13 | + axes_to_view: Axes |
| 14 | + The axes to display the contents of in the first axes, the 'viewed' |
| 15 | + axes. |
| 16 | +
|
| 17 | + image_interpolation: |
| 18 | + The image interpolation method to use when displaying scaled images |
| 19 | + from the axes being viewed. Defaults to "nearest". Supported options |
| 20 | + are 'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', |
| 21 | + 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', |
| 22 | + 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', |
| 23 | + or 'none' |
| 24 | + """ |
4 | 25 | return view_wrapper(type(axes)).from_axes(axes, axes_to_view, image_interpolation)
|
5 | 26 |
|
6 |
| -def zoom_inset_axes(axes, bounds, *, image_interpolation="nearest", transform=None, zorder=5, **kwargs): |
| 27 | + |
| 28 | +def inset_zoom_axes(axes, bounds, *, image_interpolation="nearest", transform=None, zorder=5, **kwargs): |
| 29 | + """ |
| 30 | + Add a child inset Axes to an Axes, which automatically plots |
| 31 | + artists contained within the parent Axes. |
| 32 | +
|
| 33 | + Parameters |
| 34 | + ---------- |
| 35 | + axes: Axes |
| 36 | + The axes to insert a new inset zoom axes inside. |
| 37 | +
|
| 38 | + bounds: [x0, y0, width, height] |
| 39 | + Lower-left corner of inset Axes, and its width and height. |
| 40 | +
|
| 41 | + transform: `.Transform` |
| 42 | + Defaults to `ax.transAxes`, i.e. the units of *rect* are in |
| 43 | + Axes-relative coordinates. |
| 44 | +
|
| 45 | + zorder: number |
| 46 | + Defaults to 5 (same as `.Axes.legend`). Adjust higher or lower |
| 47 | + to change whether it is above or below data plotted on the |
| 48 | + parent Axes. |
| 49 | +
|
| 50 | + image_interpolation: string |
| 51 | + Supported options are 'antialiased', 'nearest', 'bilinear', |
| 52 | + 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', |
| 53 | + 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', |
| 54 | + 'sinc', 'lanczos', or 'none'. The default value is 'nearest'. This |
| 55 | + determines the interpolation used when attempting to render a |
| 56 | + zoomed version of an image. |
| 57 | +
|
| 58 | + **kwargs |
| 59 | + Other keyword arguments are passed on to the child `.Axes`. |
| 60 | +
|
| 61 | + Returns |
| 62 | + ------- |
| 63 | + ax |
| 64 | + The created `~.axes.Axes` instance. |
| 65 | +
|
| 66 | + Examples |
| 67 | + -------- |
| 68 | + See `Axes.inset_axes` method for examples. |
| 69 | + """ |
7 | 70 | inset_ax = axes.inset_axes(bounds, transform, zorder, **kwargs)
|
8 | 71 | return view(inset_ax, axes, image_interpolation)
|
0 commit comments