Skip to content

Feature request for Fancy Arrow: allow arrow head and connector to have separate line attributes #3624

Open

Description

@breedlun

I like that annotations let me place arrows whose shape stay the same when I resize the axes, yet the positions of the arrows move with the axes.

However, I would like to be able to specify a different line attributes for the arrow head and the connector (arrow line). Specifically, I want to have a zero line width for the arrow head and a non-zero line width for the connector. Perhaps the user could specify things like the line width, line style, and line color in the connectorstyle string. For example:

anno = ax.annotate('', xy=target, xycoords='axes fraction', \
         xytext=orig, textcoords='offset points', \
         arrowprops=dict(arrowstyle='-|>', mutation_scale = 200, \
         linewidth = 0, connectionstyle = 'arc3, linewidth=1'))

Activity

  1. added this to the milestone on Oct 10, 2014
  2. KanwarGill commented on Mar 17, 2016

    @KanwarGill
    Contributor

    @breedlun @tacaswell Regarding the issue here, doesn't the FancyArrow allow you to modify the arrow head's width and/or length independently? Can you also provide another example perhaps?

    FYI @samriddhikaushik

  3. tacaswell commented on Mar 17, 2016

    @tacaswell
    Member

    Couldn't this be effectively done by

    anno = ax.annotate('', xy=target, xycoords='axes fraction', 
                       xytext=orig, textcoords='offset points', 
                       arrowprops=dict(arrowstyle='-', mutation_scale = 200, 
                                       connectionstyle = 'arc3'))
  4. breedlun commented on Mar 18, 2016

    @breedlun
    ContributorAuthor

    @KanwarGill, I would rather stick with annotate because it allows me to specify coordinates in multiple coordinate systems. Annotation also lets me keep the arrow the same shape, even as I resize the figure or axes.

    @tacaswell's suggestion produces a line without an arrowhead. I was requesting the ability to independently control the line width for the arrowhead and the connector. I still want to have a patch for the arrowhead, just no line around the perimeter of the patch. Sorry if that wasn't clear from my original post.

  5. KanwarGill commented on Mar 21, 2016

    @KanwarGill
    Contributor

    pasted image at 2016_03_21 06_06 pm
    @breedlun Is this a good example of what you want?

    fyi @samriddhikaushik @zqliang

  6. breedlun commented on Mar 22, 2016

    @breedlun
    ContributorAuthor

    @KanwarGill, yes, that is an example of what I was requesting. I was also requesting the ability to have different line styles and colors, but I would certainly be happy with only different line widths.

  7. tacaswell commented on Mar 22, 2016

    @tacaswell
    Member

    #6054 is vaguely related (touching same section of code) and you might be interested in #6117

  8. modified the milestones: , needs sorting on Oct 6, 2022
  9. github-actions commented on Oct 9, 2023

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  10. added
    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.
    on Nov 8, 2023
  11. added
    keepItems to be ignored by the “Stale” Github Action
    and removed
    status: inactiveMarked by the “Stale” Github Action
    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.
    on Nov 8, 2023
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions