1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Insert image in matplotlib legend

Discussão em 'Python' iniciado por Stack, Setembro 12, 2025.

  1. Stack

    Stack Membro Participativo

    I'd like to insert a couple small graphics (vector graphics but can be made raster if necessary) into the legend of a maplotlib plot. There would be one graphic per item in the legend.

    I know I could manually draw the entire legend using something like an annotation box but that looks tedious, and any small change in the figure would require fixing it by hand.

    Is there any way to include graphics in the label in a call to pyplot.plot or later in the pyplot.legend call?

    Continue reading...

Compartilhe esta Página