Skip to content

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

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Abitamim
Copy link

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
Member

Thank you!

Some minor comments to consider. (Hard to say which one we will go with in the end, so for what it is worth.)

I think that incorrect input should raise a ValueError rather than adjusting to be within the bounds. Not sure that having an upper limit of 10 for head_width actually makes sense. Imaging doing a very big plot etc.

It would be nice if one can modify the position of where the arrow part starts, now it can be quite crammed (but apart from that looks nice!). As I understand it, it is not possible at the moment? I seem to recall that there is a very nice illustration of the (fancy?) arrow properties somewhere that @timhoffm did. Maybe he would be kind enough to point it out? (I should have linked that in the issue I realize.)

@timhoffm
Copy link
Member

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

@story645
Copy link
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
"""
self.pad = pad
if head_width > 10:
Copy link
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
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 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

6 participants