Skip to content

Commit

Permalink
added missing args
Browse files Browse the repository at this point in the history
  • Loading branch information
colganwi committed May 15, 2024
1 parent 6252823 commit eb265fb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/pycea/pl/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def annotation(
palette: cycler.Cycler | mcolors.ListedColormap | Sequence[str] | Mapping[str] | None = None,
vmax: int | float | None = None,
vmin: int | float | None = None,
na_color: str = "white",
ax: Axes | None = None,
**kwargs,
):
Expand All @@ -151,6 +152,12 @@ def annotation(
label
Annotation labels. If `True`, the keys are used as labels.
If a string or a sequence of strings, the strings are used as labels.
vmax
The maximum value for the colormap.
vmin
The minimum value for the colormap.
na_color
The color to use for annotations with missing data.
{doc_common_plot_args}
kwargs
Additional keyword arguments passed to `matplotlib.pyplot.pcolormesh`.
Expand Down Expand Up @@ -202,14 +209,14 @@ def annotation(
end_lat = start_lat + attrs["depth"] + 2 * np.pi
lats = np.linspace(start_lat, end_lat, data.shape[1] + 1)
for col in data.columns:
rgb_array.append(_series_to_rgb_array(data[col], cmap, vmin=vmin, vmax=vmax))
rgb_array.append(_series_to_rgb_array(data[col], cmap, vmin=vmin, vmax=vmax, na_color = na_color))
else:
for key in keys:
if data[key].dtype == "category":
colors = _get_categorical_colors(tdata, key, data[key], palette)
rgb_array.append(_series_to_rgb_array(data[key], colors))
rgb_array.append(_series_to_rgb_array(data[key], colors, na_color = na_color))
else:
rgb_array.append(_series_to_rgb_array(data[key], cmap, vmin=vmin, vmax=vmax))
rgb_array.append(_series_to_rgb_array(data[key], cmap, vmin=vmin, vmax=vmax, na_color = na_color))
rgb_array = np.stack(rgb_array, axis=1)
# Plot
if attrs["polar"]:
Expand Down

0 comments on commit eb265fb

Please sign in to comment.