Skip to content

Add legend handler for Annotation #23160

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

oscargus
Copy link
Member

@oscargus oscargus commented May 29, 2022

PR Summary

Turned out to be very hard to rebase #13034 so I've cherry-picked the relevant commits and fixed the style comments. Edit: realized that #13034 was heavily based on #10688 so I've added @magedhennawy as coauthor as well.

Closes #13034
Fixes #8236

A problem here is when an annotation is added, but no arrow is given, it will break. Not sure what is expected to happen in this case. Providing a better exception is easy, something like "An annotation must have an arrow if a label is provided" while creating the annotation, but maybe better to get an empty patch in the legend?

Adding an annotation with a label, but no arrow will lead to an empty patch. In #13034 it was not handled (gave an error).

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@oscargus oscargus changed the title Add legend handler for Annotation and Add legend handler for Annotation May 29, 2022
@oscargus oscargus force-pushed the legendannotate branch 3 times, most recently from 5e1b5fe to b2d38a2 Compare May 29, 2022 16:03
Wojciech-Lange and others added 2 commits May 29, 2022 18:29
Co-authored-by: Maged Hennawy <magedhennawy@users.noreply.github.com>
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.

Legend does not show 'annotate'
2 participants