Changes between Initial Version and Version 1 of Ticket #14580


Ignore:
Timestamp:
05/20/13 11:43:25 (6 years ago)
Author:
ppurka
Comment:

I added a new attribute self._legend_colors = [] to Graphics. This will hold the colors or None in case no colors are provided. Patch needs review.

Edit: It is now possible to get a graph like this:

sage: p1 = plot(x, legend_label='this is x', legend_color='red', color='red')
sage: p2 = plot(x**2, legend_label='this is x^2', legend_color='green', color='green')
sage: (p1+p2).save('/tmp/a.png')

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14580

    • Property Status changed from new to needs_review
  • Ticket #14580 – Description

    initial v1  
    773. The key will contain a list of colors, defaulting to black or None (I prefer None, so that we use matplotlib's default).
    884. After all the plots have been rendered and the legend as been set, we can follow the method in the link above to extract all the texts and set the colors individually, skipping the ones which are None (if the default is None).
     9
     10----
     11
     12Apply [attachment:trac_14580-legend_color.patch] to devel/sage.