Skip to content

refactor: extract label positioning constants #343

@krystophny

Description

@krystophny

The axis label positioning uses hardcoded pixel values that should be extracted as named constants for better maintainability.

Locations

  • src/fortplot_raster.f90 line 1054: py offset of 30 pixels
  • src/fortplot_raster.f90 line 1069: px offset of 10 pixels
  • Similar hardcoded values in tick positioning

Recommendation

Create positioning constants module or add to margins module:

  • XLABEL_VERTICAL_OFFSET
  • YLABEL_HORIZONTAL_OFFSET
  • TICK_LABEL_OFFSET
  • TICK_MARK_LENGTH

Found during code review of PR #341

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions