Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add an.annotate method to Artist #25094

Closed as not planned
Closed as not planned
@story645

Description

@story645

I useFancyArrowPatch a lot to make diagrams and they have a lot of arrows and I'd really liketikz-like positioning of labels along the arrow. Thearrow demo has an example of the sort of manual work that goes into trying to position each label correctly and it'd be nice to move all that positioning logic inside a method onFancyArrowPatch.

image

(Discussion of migrating arrow to vector and therefore FancyArrowPatch so it could take advantage is at#22435)

For this method, we can reuse the 'ha' and 'va' arguments relative to the line, w/ n additional offset argument (here relpos, but possibly something closer to the annotate api offset(xoffset, yoffset))

ar=FancyArrowPatchar.set_label(str,offset=ratioonintervalofline,pad)#base off tikz api
leftrightcenter (default)
label
----->
----->
label
--label-->
topbottomcenter (default)
label----->--label-->
----->
label
relpos=0relpos=1relpos=.5 (default)
label----->----->label---label--->

maybe |--a1--[bbox]--a2-->

Originally posted by@story645 in#22223 (comment)

ETA: Based on the discussion below, where I've landed is that an.annotate method on artist would give me the bookkeeping I want - ease of keeping track of which annotation I put on what-and be fairly generalizable.

defannotate(self,label=None,xy=None,xytext=None,**annotation_kwargs):matplotlib.text.Annotation(text,xy,xytext,xycoords=self,**kwargs)

with annotations I guess added as child artists/sibling artists -> do we have a mechanism for this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp