| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
|
||
| class HandlerAnnotation(HandlerBase): | ||
| """ | ||
| Handler for FancyArrowPatch instances. |
There was a problem hiding this comment.
FancyArrowPatch <- Annotation?
Sorry, something went wrong.
There was a problem hiding this comment.
fixed!
Sorry, something went wrong.
|
I forgot to ping you @bendichter @tacaswell I am not sure what should be displayed when an annotation has no text and no arrow. I used a white Rectangle but this still looks awkward, would it be better (and possible?) to remove the legend entry in this case? |
Sorry, something went wrong.
|
I wonder how useful it would be to make keyword arguments for the default replacement string for long text, and the maximal length of text entries (nice and clever names would have to be found…). The use case I could see is a user that would want to deviate from the default values (e.g. from "a" for strings longer than 1 char to "Aa" for strings longer than 2 chars) without having to override the whole create_artist method of HandlerText. To do things similar to what is shown here, i.e. (with dummy names for the kwargs) plt.legend(handler_map={my_annotation: HandlerAnnotation(rep_str='Aa', str_maxlen=2)}) |
Sorry, something went wrong.
|
This looks beautiful! About the white rectangle, I can't think of a use case where you would have an annotation with no text and no arrow in the first place. I kind of liked having the white rectangle there because now I could imagine using it as a hack to give the legend subtitles. |
Sorry, something went wrong.
|
@bendichter Ok! I made the rectangle transparent to make sure it is not visible even if something is below the legend @afvincent Good point, I added these arguments and updated the example in the first comment. I also prefer 'Aa', which conveys the idea of 'some text' better than 'a' so I made it the default. |
Sorry, something went wrong.
|
@tacaswell I would say it is done. Details like the relative size of character and arrow, or which character to use to represent long strings can be discussed, but the main thing is done and functional |
Sorry, something went wrong.
|
"power cycled" to restart CI against current master. |
Sorry, something went wrong.
|
@tacaswell Many Ci fails 👎 I do not have time to fix them at the moment, can you have a shot at it? Otherwise I will come back to it, but that would not be before a month from now. |
Sorry, something went wrong.
|
Look forward to hearing from you in a month! |
Sorry, something went wrong.
|
I'll take care of this for you! |
Sorry, something went wrong.
|
Closing in lieu of the active, but not merged, #10688 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #8236
I added new legend handlers for Text, FancyArrowPatch and Annotation artists (HandlerText, HandlerFancyArrowPatch and HandlerAnnotation).
HandlerAnnotation can draw different artists in the legend:
In HandlerTuple, I added the possibility of different width ratios for the artists. HandlerAnnotation uses a width_ratios=[1,4] (ie. the arrow is 4 times wider than the text).
Example code:
output:
