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

Duplicate legend_label appears on the final plot in graphics_array #23063

Closed
sagetrac-rolandog mannequin opened this issue May 23, 2017 · 4 comments
Closed

Duplicate legend_label appears on the final plot in graphics_array #23063

sagetrac-rolandog mannequin opened this issue May 23, 2017 · 4 comments

Comments

@sagetrac-rolandog
Copy link
Mannequin

sagetrac-rolandog mannequin commented May 23, 2017

This is a bug I stumbled into when creating a graphics_array where each plot has a legend_label string. I created a Minimal Working Example (MWE) and will attach an image with the current result.

Also, upon googling I stumbled into an ask.sagemath thread that pointed to a somewhat related Trac ticket #12591.

I found what I think is a closer match by finding Trac ticket #18711 (but I still don't know enough about Sage's internals to correctly point to what is going on). That bug is still reproducible by kcrisman's code.

Does this warrant a separate ticket? Or should this be merged into #18711 ?

Here is my MWE:

def y(x=1, m=1, b=0):
    return m * x + b

data = [[[x, y(x=x, m=i, b=i)]
         for x in [1, 2, 3]]
        for i in [1, 2, 3, 4]]

plots = [list_plot(data=d,
                   legend_label=str(k + 1),
                   plotjoined=True)
         for k, d in enumerate(data)]


graphics_array(((plots[0], plots[1]),
                (plots[2], plots[3])))

And here is the MWE of #18711 :

Qx.<x>=PolynomialRing(QQ)
K.<a> = NumberField(x^2-2)
S = K.embeddings(RR)
E=EllipticCurve([a,0])
F = E.base_extend(S[0])
F.plot(legend_label='b')

CC: @kcrisman @mkoeppe @egourgoulhon

Component: graphics

Keywords: graphics_array, legend_label

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

@sagetrac-rolandog sagetrac-rolandog mannequin added this to the sage-8.0 milestone May 23, 2017
@sagetrac-rolandog
Copy link
Mannequin Author

sagetrac-rolandog mannequin commented May 23, 2017

MWE showing duplicate legend_label entry for graphics_array

@fchapoton
Copy link
Contributor

comment:1

Attachment: sage_bug_23063.png

In fact, as explained in #12591, the complete last figure is duplicated (superposed with itself). Fixing this requires some expert in matplotlib, which I am not.

NOTE that the blue color is darker in the bottom left of your picture, for the same reason.

@mkoeppe
Copy link
Member

mkoeppe commented Jul 8, 2019

Changed author from Rolando Garza to none

@mkoeppe
Copy link
Member

mkoeppe commented Jul 8, 2019

comment:3

The first test case, using graphics_array is fixed in #27865.

The second test case is from #18711 (and is unfixed as of 8.9b1); it does not need to be duplicated on this ticket.

Let's close this ticket.

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

2 participants