Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/spatialdata_plot/pl/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,9 @@ def show(
legend_fontoutline = legend_params.get("fontoutline", legend_fontoutline)
na_in_legend = legend_params.get("na_in_legend", na_in_legend)

if legend_loc == "on data":
raise ValueError("legend_loc='on data' is not supported in spatialdata-plot.")

legend_params_obj = LegendParams(
legend_fontsize=legend_fontsize,
legend_fontweight=legend_fontweight,
Expand Down
6 changes: 0 additions & 6 deletions src/spatialdata_plot/pl/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,12 +1153,6 @@ def _draw_channel_legend(
palette_dict[entry.channel_name] = entry.color_hex

legend_loc = legend_params.legend_loc
if legend_loc == "on data":
logger.warning(
"legend_loc='on data' is not supported for channel legends (no scatter coordinates); "
"falling back to 'right margin'."
)
legend_loc = "right margin"

categories = pd.Categorical(list(palette_dict))

Expand Down
Loading