| 706 | |
| 707 | |
| 708 | def _normalize_args( |
| 709 | plotmethod: str, args: tuple[Any, ...], kwargs: dict[str, Any] |
| 710 | ) -> dict[str, Any]: |
| 711 | from xarray.core.dataarray import DataArray |
| 712 | |
| 713 | # Determine positional arguments keyword by inspecting the |
| 714 | # signature of the plotmethod: |
| 715 | locals_ = dict( |
| 716 | inspect.signature(getattr(DataArray().plot, plotmethod)) |
| 717 | .bind(*args, **kwargs) |
| 718 | .arguments.items() |
| 719 | ) |
| 720 | locals_.update(locals_.pop("kwargs", {})) |
| 721 | |
| 722 | return locals_ |
| 723 | |
| 724 | |
| 725 | def _temp_dataarray(ds: Dataset, y: Hashable, locals_: dict[str, Any]) -> DataArray: |