|
846 | 846 | " data: pd.DataFrame,\n", |
847 | 847 | " x: str,\n", |
848 | 848 | " y: str,\n", |
849 | | - " ax: axes.Subplot,\n", |
| 849 | + " ax: axes.Axes,\n", |
850 | 850 | " order: List = None,\n", |
851 | 851 | " hue: str = None,\n", |
852 | 852 | " palette: Union[Iterable, str] = \"black\",\n", |
|
869 | 869 | " The column in the DataFrame to be used as the x-axis.\n", |
870 | 870 | " y : str\n", |
871 | 871 | " The column in the DataFrame to be used as the y-axis.\n", |
872 | | - " ax : axes._subplots.Subplot | axes._axes.Axes\n", |
873 | | - " Matplotlib AxesSubplot object for which the plot would be drawn on. Default is None.\n", |
| 872 | + " ax : axes.Axes\n", |
| 873 | + " Matplotlib axes.Axes object for which the plot would be drawn on. Default is None.\n", |
874 | 874 | " order : List\n", |
875 | 875 | " The order in which x-axis categories should be displayed. Default is None.\n", |
876 | 876 | " hue : str\n", |
|
895 | 895 | "\n", |
896 | 896 | " Returns\n", |
897 | 897 | " -------\n", |
898 | | - " axes._subplots.Subplot | axes._axes.Axes\n", |
899 | | - " Matplotlib AxesSubplot object for which the swarm plot has been drawn on.\n", |
| 898 | + " axes.Axes\n", |
| 899 | + " Matplotlib axes.Axes object for which the swarm plot has been drawn on.\n", |
900 | 900 | " \"\"\"\n", |
901 | 901 | " s = SwarmPlot(data, x, y, ax, order, hue, palette, zorder, size, side, jitter)\n", |
902 | 902 | " ax = s.plot(is_drop_gutter, gutter_limit, ax, **kwargs)\n", |
|
909 | 909 | " data: pd.DataFrame,\n", |
910 | 910 | " x: str,\n", |
911 | 911 | " y: str,\n", |
912 | | - " ax: axes.Subplot,\n", |
| 912 | + " ax: axes.Axes,\n", |
913 | 913 | " order: List = None,\n", |
914 | 914 | " hue: str = None,\n", |
915 | 915 | " palette: Union[Iterable, str] = \"black\",\n", |
|
929 | 929 | " The column in the DataFrame to be used as the x-axis.\n", |
930 | 930 | " y : str\n", |
931 | 931 | " The column in the DataFrame to be used as the y-axis.\n", |
932 | | - " ax : axes.Subplot\n", |
933 | | - " Matplotlib AxesSubplot object for which the plot would be drawn on.\n", |
| 932 | + " ax : axes.Axes\n", |
| 933 | + " Matplotlib axes.Axes object for which the plot would be drawn on.\n", |
934 | 934 | " order : List\n", |
935 | 935 | " The order in which x-axis categories should be displayed. Default is None.\n", |
936 | 936 | " hue : str\n", |
|
1017 | 1017 | " self.__dsize = dsize\n", |
1018 | 1018 | "\n", |
1019 | 1019 | " def _check_errors(\n", |
1020 | | - " self, data: pd.DataFrame, ax: axes.Subplot, size: float, side: str\n", |
| 1020 | + " self, data: pd.DataFrame, ax: axes.Axes, size: float, side: str\n", |
1021 | 1021 | " ) -> None:\n", |
1022 | 1022 | " \"\"\"\n", |
1023 | 1023 | " Check the validity of input parameters. Raises exceptions if detected.\n", |
|
1026 | 1026 | " ----------\n", |
1027 | 1027 | " data : pd.Dataframe\n", |
1028 | 1028 | " Input data used for generation of the swarmplot.\n", |
1029 | | - " ax : axes.Subplot\n", |
1030 | | - " Matplotlib AxesSubplot object for which the plot would be drawn on.\n", |
| 1029 | + " ax : axes.Axes\n", |
| 1030 | + " Matplotlib axes.Axes object for which the plot would be drawn on.\n", |
1031 | 1031 | " size : int | float\n", |
1032 | 1032 | " scalar value determining size of dots of the swarmplot.\n", |
1033 | 1033 | " side: str\n", |
|
1040 | 1040 | " # Type enforcement\n", |
1041 | 1041 | " if not isinstance(data, pd.DataFrame):\n", |
1042 | 1042 | " raise ValueError(\"`data` must be a Pandas Dataframe.\")\n", |
1043 | | - " if not isinstance(ax, (axes._subplots.Subplot, axes._axes.Axes)):\n", |
| 1043 | + " if not isinstance(ax, axes.Axes):\n", |
1044 | 1044 | " raise ValueError(\n", |
1045 | | - " f\"`ax` must be a Matplotlib AxesSubplot. The current `ax` is a {type(ax)}\"\n", |
| 1045 | + " f\"`ax` must be a Matplotlib axes.Axes. The current `ax` is a {type(ax)}\"\n", |
1046 | 1046 | " )\n", |
1047 | 1047 | " if not isinstance(size, (int, float)):\n", |
1048 | 1048 | " raise ValueError(\"`size` must be a scalar or float.\")\n", |
|
1302 | 1302 | " return points_data\n", |
1303 | 1303 | "\n", |
1304 | 1304 | " def plot(\n", |
1305 | | - " self, is_drop_gutter: bool, gutter_limit: float, ax: axes.Subplot, **kwargs\n", |
1306 | | - " ) -> axes.Subplot:\n", |
| 1305 | + " self, is_drop_gutter: bool, gutter_limit: float, ax: axes.Axes, **kwargs\n", |
| 1306 | + " ) -> axes.Axes:\n", |
1307 | 1307 | " \"\"\"\n", |
1308 | 1308 | " Generate a swarm plot.\n", |
1309 | 1309 | "\n", |
|
1313 | 1313 | " If True, drop points that hit the gutters; otherwise, readjust them.\n", |
1314 | 1314 | " gutter_limit : int | float\n", |
1315 | 1315 | " The limit for points hitting the gutters.\n", |
1316 | | - " ax : axes.Subplot\n", |
| 1316 | + " ax : axes.Axes\n", |
1317 | 1317 | " The matplotlib figure object to which the swarm plot will be added.\n", |
1318 | 1318 | " **kwargs:\n", |
1319 | 1319 | " Additional keyword arguments to be passed to the scatter plot.\n", |
1320 | 1320 | "\n", |
1321 | 1321 | " Returns\n", |
1322 | 1322 | " -------\n", |
1323 | | - " axes.Subplot:\n", |
1324 | | - " The matplotlib figure containing the swarm plot.\n", |
| 1323 | + " axes.Axes:\n", |
| 1324 | + " The matplotlib axes containing the swarm plot.\n", |
1325 | 1325 | " \"\"\"\n", |
1326 | 1326 | " # Input validation\n", |
1327 | 1327 | " if not isinstance(is_drop_gutter, bool):\n", |
|
0 commit comments