0

I am trying to have a legend entry for annotations on a plot. The annotations start with a certain letter, say 'a' or 'b'. I would like to have an entry in the legend reading:

a - that sort of annotation

Similar to how other entries are:

[handle] - [label]

To clarify, unlike other questions where a label is required, I want the text to be the actual handle.

I am already creating a custom legend using handles and labels.

Legend refuses a string or a plt.Text instance as a handle, returning the warning: UserWarning: Legend does not support 'a' instances. A proxy artist may be used instead.

A similar question approaches this problem from a different angle, which would work, but it was never answered.

krg
  • 317
  • 3
  • 11
  • 1
    I gave [a new answer](https://stackoverflow.com/a/57697692/4124317) to the duplicate, which handles the two possible cases of already having a text in the axes, or wanting to create a legend from a string. – ImportanceOfBeingErnest Aug 28 '19 at 17:54
  • Both are very useful, thank you. – krg Aug 28 '19 at 19:18

0 Answers0