Addresses issue #24618 "Road sign" boxstyle/annotation, alternative to #24697 by Abitamim · Pull Request #24744 · matplotlib/matplotlib · GitHub
Skip to content

Addresses issue #24618 "Road sign" boxstyle/annotation, alternative to #24697 - #24744

Closed
Abitamim wants to merge 5 commits into
matplotlib:mainfrom
Abitamim:adjustable-arrow-head-annotation
Closed

Addresses issue #24618 "Road sign" boxstyle/annotation, alternative to #24697#24744
Abitamim wants to merge 5 commits into
matplotlib:mainfrom
Abitamim:adjustable-arrow-head-annotation

Conversation

@Abitamim

Copy link
Copy Markdown
Contributor

PR Summary

This PR is to address the concerns raised in #24618. I've added the ability to specify "arrow_head" and "arrow_width" in the boxstyle attributes. By specifying "head_width=1" for DArrow, LArrow, or RArrow, this makes the head of the arrow flush with the top and bottom of the body.

I need advise on if this was the correct approach, or if I should try something else.

I have also added a test and documentation. I will likely have to redo all of these commit because git is messy, but I would like feedback on what I have done.

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@oscargus

Copy link
Copy Markdown
Member

@timhoffm

Copy link
Copy Markdown
Member

@oscargus do you mean the arrow in quiver? This does not help with BoxStyle.

@story645

Copy link
Copy Markdown
Member

@oscargus what do you think is left to do on this PR?

@ksunden ksunden mentioned this pull request Jul 21, 2023
5 tasks
@ksunden ksunden modified the milestones: v3.8.0, v3.9.0 Aug 8, 2023
Comment thread lib/matplotlib/patches.py
greater than this is contrained to the edge values.
"""
self.pad = pad
if head_width > 10:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can be done as self.head_width = np.clip(head_width, 0, 10)

@tacaswell

Copy link
Copy Markdown
Member

We like this one better than #24618 and do mostly like the parameterization (fraction of height + angle is less ambigious than two fractional lengths) but have a couple of to-dos / concerns

  • should "width" be "height" as it is a fraction of the height
  • do we need the limits on the length and angle (going greater than 180 could make >< shapes as well)
  • needs a whats new to show this off

[notes from call with @ksunden and @QuLogic ]

@timhoffm

Copy link
Copy Markdown
Member

@timhoffm timhoffm closed this Mar 26, 2026
@github-project-automation github-project-automation Bot moved this from Waiting for author to Done in First Time Contributors Mar 26, 2026
@QuLogic QuLogic modified the milestones: future releases, v3.11.0 Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

7 participants