Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH]: "Road sign" boxstyle/annotation #24618

Open
oscargus opened this issue Dec 4, 2022 · 6 comments
Open

[ENH]: "Road sign" boxstyle/annotation #24618

oscargus opened this issue Dec 4, 2022 · 6 comments
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues Good first issue Open a pull request against these issues if there are no active ones! New feature topic: annotation

Comments

@oscargus
Copy link
Contributor

oscargus commented Dec 4, 2022

Problem

Not sure what the proper name is, but it may be useful to have boxstyles as below (red part, black is the object if encloses):
image

Proposed solution

Add boxstyles/annotiation styles as above.

As there already are arrow styles, these should be called something else.

Also, one may consider what pad should mean here. Probably the left alternative where the "arrow side" is not padded (as opposed to the right alternative). Should one be possible to provide the angle or should it always be 45 degrees?

Is there a use for a double-arrowed version?

@anntzer
Copy link
Contributor

anntzer commented Dec 4, 2022

I would just make them variants over larrow/rarrow/darrow (https://matplotlib.org/devdocs/tutorials/text/annotations.html#annotating-with-boxed-text), by adding some parameters to the constructors, e.g. head_length, head_width, if possible keeping them consistent with the similarly named parameters in the corresponding arrowstyles?

@oscargus
Copy link
Contributor Author

oscargus commented Dec 4, 2022

That may indeed be a good idea which removes the naming issue if nothing else. A bit more tedious to use, but would for sure enable it (an example where this is obtained can be a nice addition as well, as IMO it looks better).

@oscargus oscargus added Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues Good first issue Open a pull request against these issues if there are no active ones! labels Dec 5, 2022
@oscargus
Copy link
Contributor Author

oscargus commented Dec 5, 2022

Marking as good first issue, but medium as there is a bit of argument handling to be done, including updating documentation and add an example. Bordering easy though. (Go with the suggestion in the comment.)

@timhoffm
Copy link
Member

timhoffm commented Dec 5, 2022

Isn't this more like making https://matplotlib.org/devdocs/tutorials/text/annotations.html#defining-custom-box-styles a first-class style?

@anntzer
Copy link
Contributor

anntzer commented Dec 5, 2022

That's also a way to do it, but I'd rather go with the "generalize larrow/rarrow" route.

@Abitamim
Copy link

Hi, I am a first time contributer to open-source. I went slightly on my own direction when creating this feature. Please let me know if it is all right, or if I should pursue an option with more flexibility in setting arrow head dimensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues Good first issue Open a pull request against these issues if there are no active ones! New feature topic: annotation
Projects
None yet
Development

No branches or pull requests

4 participants