Skip to content
  • Sponsor matplotlib/matplotlib

  • Notifications You must be signed in to change notification settings
  • Fork 7.9k

add section on annotating an artist using axes.annotate #25100

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

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

story645
Copy link
Member

@story645 story645 commented Jan 27, 2023

Jumping off of #25094, that an annotate can be positioned relative to an artist is mentioned in the annotate docstring but was missing from the tutorial buried in the coordinates section as a chaining annotations example. Figured a small example would make this functionality slightly more discoverable, and arrows are a good artist for this example since they're used for diagramming.

@tacaswell
Copy link
Member

There is a related example at

an2 = ax.annotate("Test 2",
xy=(1, 0.5), xycoords=an1, # (1, 0.5) of an1's bbox
xytext=(30, 0), textcoords="offset points",
va="center", ha="left",
bbox=dict(boxstyle="round", fc="w"),
arrowprops=dict(arrowstyle="->"))

Is it worth cross-referencing them somehow?

@story645
Copy link
Member Author

story645 commented Jan 29, 2023

Added cross reference to section and subsection

@jklymak jklymak merged commit 78442c4 into matplotlib:main Feb 3, 2023
@QuLogic QuLogic added this to the v3.8.0 milestone Feb 21, 2023
@story645 story645 deleted the annotate-artist branch October 12, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants