11from typing import Optional , Iterable , Type , Union
22from matplotlib .artist import Artist
33from matplotlib .axes import Axes
4- from matplotview ._view_axes import view_wrapper , ViewSpecification
4+ from matplotview ._view_axes import view_wrapper , ViewSpecification , DEFAULT_RENDER_DEPTH
5+ from matplotview ._docs import dynamic_doc_string , get_interpolation_list_str
56
67
78__all__ = ["view" , "inset_zoom_axes" , "ViewSpecification" ]
89
910
11+ @dynamic_doc_string (render_depth = DEFAULT_RENDER_DEPTH , interp_list = get_interpolation_list_str ())
1012def view (
1113 axes : Axes ,
1214 axes_to_view : Axes ,
@@ -28,29 +30,31 @@ def view(
2830 The axes to display the contents of in the first axes, the 'viewed'
2931 axes.
3032
31- image_interpolation: string, default of "nearest"
33+ image_interpolation: string, default of '{image_interpolation}'
3234 The image interpolation method to use when displaying scaled images
33- from the axes being viewed. Defaults to "nearest". Supported options
34- are 'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16',
35- 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
36- 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos',
37- or 'none'
35+ from the axes being viewed. Defaults to '{image_interpolation}'. Supported options
36+ are {interp_list}.
3837
3938 render_depth: optional int, positive, defaults to None
4039 The number of recursive draws allowed for this view, this can happen
4140 if the view is a child of the axes (such as an inset axes) or if
4241 two views point at each other. If None, uses the default render depth
43- of 5 , unless the axes passed is already a view axes, in which case the
42+ of {render_depth} , unless the axes passed is already a view axes, in which case the
4443 render depth the view already has will be used.
4544
4645 filter_set: Iterable[Union[Type[Artist], Artist]] or None
4746 An optional filter set, which can be used to select what artists
4847 are drawn by the view. Any artists or artist types in the set are not
4948 drawn.
5049
51- scale_lines: bool, defaults to True
50+ scale_lines: bool, defaults to {scale_lines}
5251 Specifies if lines should be drawn thicker based on scaling in the
5352 view.
53+
54+ Returns
55+ -------
56+ axes
57+ The modified `~.axes.Axes` instance which is now a view.
5458 """
5559 view_obj = view_wrapper (type (axes )).from_axes (axes , render_depth )
5660 view_obj .view_specifications [axes_to_view ] = ViewSpecification (
@@ -61,6 +65,7 @@ def view(
6165 return view_obj
6266
6367
68+ @dynamic_doc_string (render_depth = DEFAULT_RENDER_DEPTH , interp_list = get_interpolation_list_str ())
6469def inset_zoom_axes (
6570 axes : Axes ,
6671 bounds : Iterable ,
@@ -69,7 +74,7 @@ def inset_zoom_axes(
6974 render_depth : Optional [int ] = None ,
7075 filter_set : Optional [Iterable [Union [Type [Artist ], Artist ]]] = None ,
7176 scale_lines : bool = True ,
72- transform = None ,
77+ transform = None ,
7378 zorder : int = 5 ,
7479 ** kwargs
7580) -> Axes :
@@ -90,31 +95,28 @@ def inset_zoom_axes(
9095 Axes-relative coordinates.
9196
9297 zorder: number
93- Defaults to 5 (same as `.Axes.legend`). Adjust higher or lower
98+ Defaults to {zorder} (same as `.Axes.legend`). Adjust higher or lower
9499 to change whether it is above or below data plotted on the
95100 parent Axes.
96101
97102 image_interpolation: string
98- Supported options are 'antialiased', 'nearest', 'bilinear',
99- 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
100- 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
101- 'sinc', 'lanczos', or 'none'. The default value is 'nearest'. This
103+ Supported options are {interp_list}. The default value is '{image_interpolation}'. This
102104 determines the interpolation used when attempting to render a
103105 zoomed version of an image.
104106
105107 render_depth: optional int, positive, defaults to None
106108 The number of recursive draws allowed for this view, this can happen
107109 if the view is a child of the axes (such as an inset axes) or if
108110 two views point at each other. If None, uses the default render depth
109- of 5 , unless the axes passed is already a view axes, in which case the
111+ of {render_depth} , unless the axes passed is already a view axes, in which case the
110112 render depth the view already has will be used.
111113
112114 filter_set: Iterable[Union[Type[Artist], Artist]] or None
113115 An optional filter set, which can be used to select what artists
114116 are drawn by the view. Any artists or artist types in the set are not
115117 drawn.
116118
117- scale_lines: bool, defaults to True
119+ scale_lines: bool, defaults to {scale_lines}
118120 Specifies if lines should be drawn thicker based on scaling in the
119121 view.
120122
0 commit comments