Skip to content

Rewrite markers placement - #112

Open
jgieseler wants to merge 4 commits into
mainfrom
markers_placement
Open

jgieseler wants to merge 4 commits into
mainfrom
markers_placement

Conversation

@jgieseler

@jgieseler jgieseler commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Addresses #106. This pull request makes several improvements to the way plot markers and legends are handled in the solarmach plotting functions. The main focus is on enhancing the clarity and maintainability of marker annotations (especially numbered markers) and their representation in the legend. A new custom legend handler is introduced to support this, and redundant or complex code for manual legend positioning is removed.

Legend and marker handling improvements:

  • Added a custom legend handler class _NumberedHandlerLine2D to display marker numbers directly in the legend, making numbered markers clearer and more consistent between the plot and legend.
  • Updated the logic in both plot and plot_pfss methods to use this new handler for numbered markers in the legend, replacing manual annotation logic and simplifying code for marker handling. [1] [2]
  • Refactored legend creation to dynamically build the handler_map and associate handles with the appropriate custom handler, improving maintainability and flexibility. [1] [2]

Marker annotation visual tweaks:

  • Refactor the appearance of number/letter marker annotations on the plots by adjusting text offset and font weight, making the code future-proof by replacing to-be-deprecated matplotlib code. [1] [2]

Imports:

  • Updated imports to include HandlerLine2D from matplotlib.legend_handler for use with the new custom legend handler.

@jgieseler jgieseler self-assigned this Oct 1, 2026
@jgieseler jgieseler added bug Something isn't working enhancement New feature or request labels Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant