First time here? Check out the FAQ!

Ask Your Question
0

Bug in legend_label of list_plot?

asked 12 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi, Suppose lstR and lstS are two lists of real numbers.

X = list_plot(lstR, plotjoined = True, color='black', marker = 'o', linestyle="-", legend_label='$R$', axes_labels=['Trial number', 'Value'])
Y = list_plot(lstS, plotjoined = True, color='black', marker = 's', linestyle="--", legend_label='$S$', axes_labels=['Trial number', 'Value'])      
(X+Y).show()

The legend label for R is two squares joined by a line instead of two circles joined by a line. Is this a bug? (I am unable to upload the plot image because my karma is not > 60.)

Preview: (hide)

Comments

On the other hand, `(X+Y).save('tmp.eps')` displays the legend labels correctly.

Iftikhar Burhanuddin gravatar imageIftikhar Burhanuddin ( 12 years ago )

2 Answers

Sort by » oldest newest most voted
1

answered 12 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I recently filed a bug report on this. Problem seems somewhere in sage. It's hard to figure out where :( The problem is only in the marker type 'o'; the other marker types work just fine. So, simply avoid 'o'!

See: http://trac.sagemath.org/sage_trac/ti...

Preview: (hide)
link

Comments

We just realized that the upgrade to matplotlib 1.2.0 fixes this issue. See the trac ticket above for discussion.

Jason Grout gravatar imageJason Grout ( 12 years ago )
0

answered 12 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Yes, it is a bug. Thanks for posting about this!

Here is a minimal example showing that the real problem is that if marker='o', then the legend shows a square while the graph shows a circle.

Preview: (hide)
link

Comments

How do I circumvent this bug to get the legend labels right?

Iftikhar Burhanuddin gravatar imageIftikhar Burhanuddin ( 12 years ago )

It looks like things work well if you avoid `marker='o'`

Jason Grout gravatar imageJason Grout ( 12 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

Stats

Asked: 12 years ago

Seen: 474 times

Last updated: Nov 12 '12