Opened 7 years ago

Last modified 7 years ago

#18543 new defect

legend label doesn't distinguish line and dash

Reported by: kcrisman Owned by:
Priority: major Milestone: sage-6.8
Component: graphics Keywords:
Cc: ppurka Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Compare the output of these three.

sage: plot(x,(x,1,100),linestyle=':', legend_label='foo')

sage: plot(x,(x,1,100),linestyle='--', legend_label='foo')

sage: plot(x,(x,1,100),linestyle='-', legend_label='foo')

There is a very subtle difference between the last two, I think, but not enough to be useful. Let's fix this.

Originally reported at this ask.sagemath question.

Change History (8)

comment:1 Changed 7 years ago by kcrisman

Note that the legend options allow this to be fixed, in principle, but I'm not sure what the defaults should be.

comment:2 follow-up: Changed 7 years ago by ppurka

I am pretty sure this should work : legend_handlelength=2,. I used this some years earlier in my work. See the end of the file here : https://github.com/ppurka/papers/blob/master/decoding_permutations/sage/run_simulation.sage

comment:3 in reply to: ↑ 2 Changed 7 years ago by kcrisman

I am pretty sure this should work : legend_handlelength=2,. I used this some years earlier in my work. See the end of the file here : https://github.com/ppurka/papers/blob/master/decoding_permutations/sage/run_simulation.sage

I tried that, but only P.set_legend_options(handlelength=2) seemed to work. Maybe I needed to do it in show and not just the plot?

Anyway, the ticket is about defaults and what we should have to fix this.

comment:4 Changed 7 years ago by ppurka

Yes. I think the legends are parsed during show or save, not in plot.

comment:5 Changed 7 years ago by kcrisman

So maybe that is also a bug, that one can't just send legend_handlelength=2 directly in plot. What do you think?

comment:6 Changed 7 years ago by ppurka

There are many things that can't be set through plot I think. This is not really a bug.

comment:7 Changed 7 years ago by ppurka

Ok. It is a bug since the documentation days "Extra options will get passed on to show(), as long as they are valid:"

comment:8 Changed 7 years ago by kcrisman

Right - or the documentation is wrong. But in theory everything is supposed to get passed on to show.

In fact, that is #10616 - I knew that I had seen that somewhere!

(Also barely related is #13543.)

Note: See TracTickets for help on using tickets.