Opened 9 years ago

Closed 8 years ago

#10514 closed defect (fixed)

legend_label doesn't work when plotting multiple functions at the same time

Reported by: jason Owned by: jason, was
Priority: minor Milestone: sage-5.1
Component: graphics Keywords: so40.5
Cc: kcrisman Merged in: sage-5.1.beta4
Authors: Douglas McNeil Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #12960 Stopgaps:

Description (last modified by kcrisman)

This gives a legend:

plot(x,legend_label='test')+plot(x^2,legend_label='test')

but this doesn't:

plot([x,x^2], legend_label='test')

Apply trac_10514_multiple_function_legend.patch and trac_10514-reviewer.patch.

Attachments (2)

trac_10514_multiple_function_legend.patch (1.7 KB) - added by dsm 8 years ago.
be less aggressive about pruning legend labels
trac_10514-reviewer.patch (1.2 KB) - added by kcrisman 8 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by kcrisman

  • Cc kcrisman added

Changed 8 years ago by dsm

be less aggressive about pruning legend labels

comment:2 Changed 8 years ago by dsm

  • Authors set to Douglas McNeil
  • Keywords so40.5 added
  • Status changed from new to needs_review

Patch attached. Note that this depends upon trac_12960-fix_legend.2.patch, not for the fix itself, but for the doctest.

comment:3 Changed 8 years ago by dsm

  • Dependencies set to 12960

comment:4 Changed 8 years ago by kcrisman

  • Dependencies changed from 12960 to #12960

Looking at this. Doug - note that it's best to use the #12960 syntax so one can click on the hyperlink created.

comment:5 Changed 8 years ago by kcrisman

I'm adding a doctest for people to see this as well in the live documentation.

Why the extra blank lines?

Also, note that even this didn't work before.

sage: q1 = plot([sin(x)], legend_label='trig'); q1

which I assume why you did the test you did.

Reviewer patch coming up.

Changed 8 years ago by kcrisman

comment:6 Changed 8 years ago by kcrisman

  • Description modified (diff)
  • Reviewers set to Karl-Dieter Crisman
  • Status changed from needs_review to positive_review

comment:7 Changed 8 years ago by jdemeyer

  • Status changed from positive_review to needs_work

This conflicts with #11998.

comment:8 Changed 8 years ago by dsm

Am I the only one who finds it funny that a patch described as "be less aggressive about pruning legend labels" conflicts with a patch called "be more aggressive about pruning legend labels"?

I'll try letting #10514 take priority and modify #11998 to deal with it.

comment:9 Changed 8 years ago by jdemeyer

  • Status changed from needs_work to positive_review

comment:10 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.1.beta4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.