Opened 10 years ago

Last modified 10 years ago

#12936 closed enhancement

Adding plots should (at least attempt to) preserve legend options — at Version 3

Reported by: mjo Owned by: jason, was
Priority: major Milestone: sage-5.1
Component: graphics Keywords:
Cc: Merged in:
Authors: Michael Orlitzky Reviewers: Andrey Novoseltsev
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mjo)

The __add__() method of plots doesn't make any attempt to preserve legend options. This will show the default legend:

sage: p1 = plot(x, x, 0, 1, legend_label='foo')             
sage: p1.set_legend_options(back_color='white', shadow=True)
sage: p2 = p1 + p1                                          
sage: p2._Graphics__legend_opts                             
{}

We do preserve some other information, so it should be easy to add this.

Change History (4)

comment:1 Changed 10 years ago by mjo

  • Authors set to Michael Orlitzky
  • Status changed from new to needs_review

comment:2 follow-up: Changed 10 years ago by novoselt

  • Reviewers set to Andrey Novoseltsev
  • Status changed from needs_review to needs_work

This is a nice improvement, but the patch does not apply for me on Sage-5.0.rc0. Either it has to be rebased, or there are some dependencies.

comment:3 in reply to: ↑ 2 Changed 10 years ago by mjo

  • Description modified (diff)

Replying to novoselt:

This is a nice improvement, but the patch does not apply for me on Sage-5.0.rc0. Either it has to be rebased, or there are some dependencies.

Not only that, but I forgot to set any options in the description =)

I just built rc1 and will fix it.

Changed 10 years ago by mjo

Merge plot options the same way we do other keyword arguments.

Note: See TracTickets for help on using tickets.