ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 12 Nov 2012 03:28:47 -0600Bug in legend_label of list_plot?http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/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.)Sat, 10 Nov 2012 16:44:35 -0600http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/Comment by Iftikhar Burhanuddin for <p>Hi, Suppose <code>lstR</code> and <code>lstS</code> are two lists of real numbers.</p>
<pre><code>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()
</code></pre>
<p>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.)</p>
http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18727#post-id-18727On the other hand, `(X+Y).save('tmp.eps')` displays the legend labels correctly.Sat, 10 Nov 2012 17:41:27 -0600http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18727#post-id-18727Answer by ppurka for <p>Hi, Suppose <code>lstR</code> and <code>lstS</code> are two lists of real numbers.</p>
<pre><code>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()
</code></pre>
<p>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.)</p>
http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?answer=14255#post-id-14255I 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/ticket/13690Sun, 11 Nov 2012 17:09:46 -0600http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?answer=14255#post-id-14255Comment by Jason Grout for <p>I recently filed a bug report on this. Problem seems somewhere in sage. It's hard to figure out where :(
The problem is <em>only</em> in the marker type 'o'; the other marker types work just fine. So, simply avoid 'o'!</p>
<p>See: <a href="http://trac.sagemath.org/sage_trac/ticket/13690">http://trac.sagemath.org/sage_trac/ti...</a></p>
http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18723#post-id-18723We just realized that the upgrade to matplotlib 1.2.0 fixes this issue. See the trac ticket above for discussion.Mon, 12 Nov 2012 03:28:47 -0600http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18723#post-id-18723Answer by Jason Grout for <p>Hi, Suppose <code>lstR</code> and <code>lstS</code> are two lists of real numbers.</p>
<pre><code>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()
</code></pre>
<p>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.)</p>
http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?answer=14073#post-id-14073Yes, it is a bug. Thanks for posting about this!
Here is a minimal [example](http://aleph.sagemath.org/?z=eJzLycxL1UjNK81NLUosSdWINtQx0jGM1dRRyE0syk4tUrBVUM9X11HISU1PzUuJz0lMSs2xVU9U1wQACx0Rww==&lang=sage) showing that the real problem is that if `marker='o'`, then the legend shows a square while the graph shows a circle.
Sat, 10 Nov 2012 17:32:13 -0600http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?answer=14073#post-id-14073Comment by Jason Grout for <p>Yes, it is a bug. Thanks for posting about this!</p>
<p>Here is a minimal <a href="http://aleph.sagemath.org/?z=eJzLycxL1UjNK81NLUosSdWINtQx0jGM1dRRyE0syk4tUrBVUM9X11HISU1PzUuJz0lMSs2xVU9U1wQACx0Rww==&lang=sage">example</a> showing that the real problem is that if <code>marker='o'</code>, then the legend shows a square while the graph shows a circle.</p>
http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18726#post-id-18726It looks like things work well if you avoid `marker='o'`Sat, 10 Nov 2012 17:43:45 -0600http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18726#post-id-18726Comment by Iftikhar Burhanuddin for <p>Yes, it is a bug. Thanks for posting about this!</p>
<p>Here is a minimal <a href="http://aleph.sagemath.org/?z=eJzLycxL1UjNK81NLUosSdWINtQx0jGM1dRRyE0syk4tUrBVUM9X11HISU1PzUuJz0lMSs2xVU9U1wQACx0Rww==&lang=sage">example</a> showing that the real problem is that if <code>marker='o'</code>, then the legend shows a square while the graph shows a circle.</p>
http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18728#post-id-18728How do I circumvent this bug to get the legend labels right?Sat, 10 Nov 2012 17:37:55 -0600http://ask.sagemath.org/question/9520/bug-in-legend_label-of-list_plot/?comment=18728#post-id-18728