Opened 4 years ago

Closed 23 months ago

#23063 closed defect (duplicate)

Duplicate legend_label appears on the final plot in graphics_array

Reported by: rolandog Owned by:
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords: graphics_array, legend_label
Cc: kcrisman, mkoeppe, egourgoulhon Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

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')

Attachments (1)

sage_bug_23063.png (35.4 KB) - added by rolandog 4 years ago.
MWE showing duplicate legend_label entry for graphics_array

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by rolandog

MWE showing duplicate legend_label entry for graphics_array

comment:1 Changed 4 years ago by chapoton

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.

Version 0, edited 4 years ago by chapoton (next)

comment:2 Changed 4 years ago by mkoeppe

  • Cc mkoeppe added

comment:3 Changed 23 months ago by mkoeppe

  • Authors Rolando Garza deleted
  • Cc egourgoulhon added
  • Milestone changed from sage-8.0 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

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.

comment:4 Changed 23 months ago by chapoton

  • Resolution set to duplicate
  • Status changed from needs_review to closed
Note: See TracTickets for help on using tickets.