Skip to content

DOC: Emphasize artist as annotation in AnnotationBbox demo and add to annotation guide#29374

Merged
timhoffm merged 1 commit intomatplotlib:mainfrom
story645:annotationbbox
Feb 16, 2026
Merged

DOC: Emphasize artist as annotation in AnnotationBbox demo and add to annotation guide#29374
timhoffm merged 1 commit intomatplotlib:mainfrom
story645:annotationbbox

Conversation

@story645
Copy link
Copy Markdown
Member

@story645 story645 commented Dec 22, 2024

PR summary

Motivated by wanting to position an image relative to text and being confused, I reworked the AnnotationBBox demo:

  • emphasize that this is a method for using artists as annotations, because that wasn't clear to me when I was looking through the docs
  • broke up the demo into separate sections (text, image, arbitrary artist based on the different offset box classes) because I was having trouble keeping my place and mapping code to image when I was using this example to make something.

Also added AnnotationBbox to the Annotation guide because it's currently not there. And documented offsetimagebox per @timhoffm's review.

Current docs:

ETA: AI disclosure

Used AI as fancy grep for dpi_cor and zoom.

PR checklist

@github-actions github-actions Bot added Documentation: examples files in galleries/examples Documentation: user guide files in galleries/users_explain or doc/users labels Dec 22, 2024
@story645 story645 force-pushed the annotationbbox branch 2 times, most recently from 04e428f to 91d2558 Compare December 23, 2024 05:35
@story645 story645 changed the title DOC: break up AnnotationBbox demo and add AnnotationBbox to annotation guide DOC: Emphasize artist as annotation in AnnotationBbox demo and add to annotation guide Dec 24, 2024
Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
@story645 story645 marked this pull request as draft January 21, 2025 05:02
@story645
Copy link
Copy Markdown
Member Author

putting back to draft cause dunno when I'll get around to documenting offsetImage and BboxImage

@story645
Copy link
Copy Markdown
Member Author

story645 commented Feb 6, 2026

I'm making my best guess at what dpi_cor means in the offsetImage context, but @leejjoon any chance you remember? or anyone from #5112

@story645 story645 marked this pull request as ready for review February 6, 2026 01:13
@story645
Copy link
Copy Markdown
Member Author

story645 commented Feb 6, 2026

Um, I'm somewhat guessing that zoom here behaves the same way as zoom in matlab (and that it may have been renamed magnification in other functions).

Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
@story645 story645 force-pushed the annotationbbox branch 2 times, most recently from 51ea1ef to a68376e Compare February 9, 2026 02:47
Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take or leave my suggestion.

Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
@story645 story645 added this to the v3.11.0 milestone Feb 11, 2026
Comment thread galleries/examples/text_labels_and_annotations/demo_annotation_box.py Outdated
Comment thread galleries/users_explain/text/annotations.py
Comment thread lib/matplotlib/offsetbox.py Outdated
to annotation guide, and documents the OffsetImage class

Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@timhoffm timhoffm merged commit 77f1a4b into matplotlib:main Feb 16, 2026
40 checks passed
@story645 story645 deleted the annotationbbox branch February 16, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: examples files in galleries/examples Documentation: user guide files in galleries/users_explain or doc/users topic: annotation topic: images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants