Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Format contour norm routing changes
  • Loading branch information
cvanelteren committed Feb 26, 2026
commit 940ac89f649fe0470355b1142db2be6f2ab03963
4 changes: 3 additions & 1 deletion ultraplot/axes/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4837,7 +4837,9 @@ def _parse_level_norm(
# with explicit limits or qualitative color lists, keep the continuous
# normalizer to preserve one-to-one value->color mapping.
center_levels = _not_none(center_levels, rc["colorbar.center_levels"])
Comment on lines +4846 to 4849
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _parse_level_norm docstring says it returns a DiscreteNorm/BoundaryNorm, but with the new min_levels == 1 behavior it can return the original continuous Normalize (line contours). Please update the Returns section to reflect the possible return types so users don't rely on an incorrect contract.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

preserve_line_mapping = preserve_line_limits or (min_levels == 1 and qualitative)
preserve_line_mapping = preserve_line_limits or (
min_levels == 1 and qualitative
)
if (
not preserve_line_mapping
and not isinstance(norm, mcolors.BoundaryNorm)
Expand Down