Ask Your Question
0

showing dashed line in the legend box

asked 9 years ago

Nownuri1 gravatar image

updated 9 years ago

Could anyone let me know how you can change the style of the line in the legend box? I'm struggling with this for 2 hours. I can only change the fontsize of legend_label and color and etc. Please help me!

This is a part of my code for the plot

Lg1=plot(f1, (x, 1, 100),  ticks=[None, [0.000005, 1/5, 10^-5, 10^-4, 10^-3, 10^-2, 10^-1]], scale=('loglog', 10), ymin=0, ymax=1, axes_labels=['Distance between led and camera [m]','Illuminace on camera sensor[lux]'],axes=None, axes_pad=False, legend_label='$I=2cd$, $L_s=50m$', frame=True, color='blue');
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 9 years ago

kcrisman gravatar image

updated 9 years ago

Believe it or not, there is a very subtle difference between linestyle='--' and the default, but you are right that it's not really visible and I've opened ticket 18543 for this.

Edit: as a workaround, you can do

sage: P = plot(x,(x,1,100),linestyle='--', legend_label='foo')
sage: P.set_legend_options(handlelength=2)
sage: P

and perhaps that will be nicer anyway. See here for the full set of legend options.

Preview: (hide)
link

Comments

Thank you for the answer. It means that the reason why I couldn't see dashed lines in the legend was just the small size of legend box. Is it correct?

Nownuri1 gravatar imageNownuri1 ( 9 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 606 times

Last updated: May 30 '15