Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding plots should (at least attempt to) preserve legend options #12936

Closed
orlitzky opened this issue May 10, 2012 · 8 comments
Closed

Adding plots should (at least attempt to) preserve legend options #12936

orlitzky opened this issue May 10, 2012 · 8 comments

Comments

@orlitzky
Copy link
Contributor

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.

Component: graphics

Author: Michael Orlitzky

Reviewer: Andrey Novoseltsev

Merged: sage-5.1.beta1

Issue created by migration from https://trac.sagemath.org/ticket/12936

@orlitzky
Copy link
Contributor Author

Author: Michael Orlitzky

@novoselt
Copy link
Member

comment:2

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.

@novoselt
Copy link
Member

Reviewer: Andrey Novoseltsev

@orlitzky
Copy link
Contributor Author

comment:3

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.

@orlitzky

This comment has been minimized.

@orlitzky
Copy link
Contributor Author

Attachment: sage-trac_12936.patch.gz

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

@orlitzky
Copy link
Contributor Author

comment:4

Should be fixed now. It looks like that method was just moved to graphics.py.

@jdemeyer
Copy link

Merged: sage-5.1.beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants