Skip to content

Commit

Permalink
Update facetgrid.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Apr 7, 2024
1 parent 6e13194 commit c26233e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions xarray/plot/facetgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def map_plot1d(
func_kwargs["add_title"] = False

add_labels_ = np.zeros(self.axs.shape + (3,), dtype=bool)
if kwargs.get("z") is not None:
if coords_to_plot["z"] is not None:
# 3d plots looks better with all labels. 3d plots can't sharex either so it
# is easy to get lost while rotating the plots:
add_labels_[:] = True
Expand All @@ -490,10 +490,10 @@ def map_plot1d(
# Set up the lists of names for the row and column facet variables:
if self._single_group:
full = tuple(
{self._single_group: x}
for x in range(0, self.data[self._single_group].size)
{self._single_group: v}
for v in range(0, self.data[self._single_group].size)
)
empty = tuple(None for x in range(self._nrow * self._ncol - len(full)))
empty = (None,) * (self._nrow * self._ncol - len(full))
name_d = full + empty
else:
rowcols = itertools.product(
Expand All @@ -513,8 +513,9 @@ def map_plot1d(
subset = self.data.isel(d)
mappable = func(
subset,
x=x,
y=y,
x=coords_to_plot["x"],
y=coords_to_plot["y"],
z=coords_to_plot["z"],
ax=ax,
hue=hue,
_size=size_,
Expand Down

0 comments on commit c26233e

Please sign in to comment.