FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Doc]: Bracket ArrowStyle Angle Unclear · Issue #23176 · matplotlib/matplotlib · GitHub

Repository navigation

[Doc]: Bracket ArrowStyle Angle Unclear #23176

Closed

Description

Documentation Link

https://matplotlib.org/devdocs/users/prev_whats_new/whats_new_3.4.0.html?highlight=bracket#angles-on-bracket-arrow-styles

Problem

I can't tell from this figure what Angle = 60 is relative to, since the top angle is >60 and the lower angle is <60 in the first example, and '0 degrees means perpendicular to the line' is buried in the api docs (I missed what that means like 6 times)

Suggested improvement

An example, that's cross referenced against the API docs, where the angle is marked up, similar to the scale invariant docs

I think it'd be nice to include the formulas for setting the bracket horizontal or vertical relative to the axes, but that's totally extra. I think it's a good first issue since it's completely standalone, a relatively small addition, and this information is missing.

Activity

  1. llricci commented on Jun 13, 2022

    Contributor

    Hello, I would like to work with that issue. However, I think I did not completely understand your idea, it is to draw the angles in the image to make it more clear, like in your sugestion?

  2. story645 commented on Jun 13, 2022

    MemberAuthor

    Exactly, a

    1. new gallery example (this may end up appended to an existing example, but easier if you start it new)
    2. that looks like the bracket example from what's new
    3. where the angle argument is annotated like in the scale invariant angle
  3. llricci commented on Jun 14, 2022

    Contributor

    @story645 Something like this?

  4. story645 commented on Jun 14, 2022

    MemberAuthor

    Yup, except the angle is always between the brace and the perpendicular

  5. llricci commented on Jun 14, 2022

    Contributor

    I see, but I'm unsure how I would do that with matplotlib

  6. story645 commented on Jun 14, 2022

    MemberAuthor

    I think by importing the ArcAnnotation class from the scale invariant example (you can cross link in the text) and using that to label the angles. I think the perpendicular can be drawn using either vlines or plot.

  7. llricci commented on Jun 14, 2022

    Contributor

    Ok, thanks. I'll see this tomorrow

  8. llricci commented on Jun 15, 2022

    Contributor

    I successfully created the lines using vlines() but I can't do the same with Arc()

  9. jacoverster commented on Oct 7, 2022

    Contributor

    Hi @story645, can I contribute to this issue? Is this what you are looking for:

  10. story645 commented on Oct 7, 2022

    MemberAuthor

    That looks great! Go for it!!!

  11. timhoffm commented on Oct 7, 2022

    Member

    Bonus: Maybe add an arrow head to the grey arc to indicate the angle direction (from the blue line to the bracket)?

  12. jacoverster commented on Oct 7, 2022

    Contributor

    Sure thing @timhoffm, I'll look into that.

  13. jacoverster commented on Oct 11, 2022

    Contributor

    Hi @timhoffm, I looked at a few ways of adding the arrows.

    One way is to simply add a FancyArrowPatch to the plot (as shown below), but this won't be scale invariant.

    Secondly, I added an arrow annotation to AngleAnnotation (similar to the text annotation):

    self.arrow = ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0), arrowprops=arrowprops, **self.kw)

    I then tried to update it's position at plot time. I can easily set self.arrow.yx (similar to self.text.xy) but can't access the xytext variable (arrow._arrow_relpos I believe) to tell the updated arrow where to point from.

    Is it possible to set this during plot time, and if not do you have any other suggestions? Am I on the right track or is the FancyArrowPatch solution fine?

  14. 7 remaining items

  15. added a commit that references this issue on Oct 26, 2022
  16. added a commit that references this issue on Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentation🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL