Skip to content

2D Snapshot Readibility of centroid circles and labels#87

Merged
Hendrik-code merged 1 commit into
mainfrom
snapshot_readability
Jun 11, 2025
Merged

2D Snapshot Readibility of centroid circles and labels#87
Hendrik-code merged 1 commit into
mainfrom
snapshot_readability

Conversation

@Hendrik-code

Copy link
Copy Markdown
Owner

added contrasting color function to give text of centroids and circles gray or black border depending on its color. made text larger, so that the snapshots are better readable

…s gray or black border depending on its color. made text larger, so that the snapshots are better readable
@Hendrik-code Hendrik-code self-assigned this Jun 11, 2025
@Hendrik-code Hendrik-code added enhancement New feature or request spine Spine specific features labels Jun 11, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the 2D snapshot readability by enhancing the contrast and size of centroid circles and their labels.

  • Introduces a new utility function to select contrasting stroke colors.
  • Increases centroid circle radius and updates text styling with stroke effects.
  • Adjusts arrow color computation (though the modulo arithmetic uses a mismatched variable).
Comments suppressed due to low confidence (2)

TPTBox/spine/snapshot2D/snapshot_modular.py:508

  • The expression for computing the arrow color uses 'color - 1 % LABEL_MAX % cmap.N', but 'color' is already a mapped color from cmap. Consider using the same index calculation as for circles (e.g., (k1 - 1) % LABEL_MAX % cmap.N) to ensure consistent coloring.
axs.add_patch(FancyArrow(v[1] * zms[1], v[0] * zms[0], c, d, color=cmap(color - 1 % LABEL_MAX % cmap.N)))

TPTBox/spine/snapshot2D/snapshot_modular.py:587

  • The arrow color calculation uses 'color - 1 % LABEL_MAX % cmap.N' where 'color' has already been set via cmap. To maintain consistency with other elements, use the appropriate index (e.g., (k1 - 1) % LABEL_MAX % cmap.N) for determining the arrow color.
axs.add_patch(FancyArrow(v[2] * zms[2], v[0] * zms[0], c, d, color=cmap(color - 1 % LABEL_MAX % cmap.N)))

@Hendrik-code Hendrik-code merged commit fab3d9d into main Jun 11, 2025
2 checks passed
@Hendrik-code Hendrik-code deleted the snapshot_readability branch June 11, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request spine Spine specific features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants