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.Thu, 15 Jan 2015 20:15:33 -0600Markers in list_plothttp://ask.sagemath.org/question/9581/markers-in-list_plot/ Hello!
I discovered today that one cannot use the *marker* property with *list_plot()*. So I would like to know if this hasn't been implemented yet (but planned) or there is another way to be used?
Thanks!
**Edit:** I tried to use
list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v')
and it indeed let me use different form of markers, but in the case when *DATA_LIST* consists of only one element, the point placed incorrectly on the resulting plot.
**Edit 2:** I remembered that there were some problems associated with the logarithmic scales on the axes. That is why I re-read [this thread](https://groups.google.com/forum/?fromgroups=#!topic/sage-devel/OnhVtHXgdls ) and realized that I have to add an *axes_pad=0* parameter in order to get the correctly placed points. So the resuling work-around for a *loglog* scale would look like this:
list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v', scale='loglog', axes_pad=0)Wed, 28 Nov 2012 06:23:35 -0600http://ask.sagemath.org/question/9581/markers-in-list_plot/Answer by kcrisman for <p>Hello!
I discovered today that one cannot use the <em>marker</em> property with <em>list_plot()</em>. So I would like to know if this hasn't been implemented yet (but planned) or there is another way to be used?</p>
<p>Thanks!</p>
<p><strong>Edit:</strong> I tried to use </p>
<pre><code>list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v')
</code></pre>
<p>and it indeed let me use different form of markers, but in the case when <em>DATA_LIST</em> consists of only one element, the point placed incorrectly on the resulting plot.</p>
<p><strong>Edit 2:</strong> I remembered that there were some problems associated with the logarithmic scales on the axes. That is why I re-read <a href="https://groups.google.com/forum/?fromgroups=#!topic/sage-devel/OnhVtHXgdls ">this thread</a> and realized that I have to add an <em>axes_pad=0</em> parameter in order to get the correctly placed points. So the resuling work-around for a <em>loglog</em> scale would look like this:</p>
<pre><code>list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v', scale='loglog', axes_pad=0)
</code></pre>
http://ask.sagemath.org/question/9581/markers-in-list_plot/?answer=14317#post-id-14317I use `line` with an empty linestyle.
sage: l = enumerate(range(10))
sage: l
<enumerate object at 0x10d433190>
sage: line(l,linestyle='', marker='v')
This seems to work with just one point, as does
sage: list_plot([(1,2)],plotjoined=True,linestyle='',marker='v')Wed, 28 Nov 2012 07:19:50 -0600http://ask.sagemath.org/question/9581/markers-in-list_plot/?answer=14317#post-id-14317Comment by v_2e for <p>I use <code>line</code> with an empty linestyle.</p>
<pre><code>sage: l = enumerate(range(10))
sage: l
<enumerate object at 0x10d433190>
sage: line(l,linestyle='', marker='v')
</code></pre>
<p>This seems to work with just one point, as does</p>
<pre><code>sage: list_plot([(1,2)],plotjoined=True,linestyle='',marker='v')
</code></pre>
http://ask.sagemath.org/question/9581/markers-in-list_plot/?comment=18634#post-id-18634Yes, it turned out that in my case the problem was because of the 'loglog' scale. I added a 'axes_pad=0' parameter and obtained a correct result. Thanks!Wed, 28 Nov 2012 07:39:12 -0600http://ask.sagemath.org/question/9581/markers-in-list_plot/?comment=18634#post-id-18634Answer by FrédéricC for <p>Hello!
I discovered today that one cannot use the <em>marker</em> property with <em>list_plot()</em>. So I would like to know if this hasn't been implemented yet (but planned) or there is another way to be used?</p>
<p>Thanks!</p>
<p><strong>Edit:</strong> I tried to use </p>
<pre><code>list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v')
</code></pre>
<p>and it indeed let me use different form of markers, but in the case when <em>DATA_LIST</em> consists of only one element, the point placed incorrectly on the resulting plot.</p>
<p><strong>Edit 2:</strong> I remembered that there were some problems associated with the logarithmic scales on the axes. That is why I re-read <a href="https://groups.google.com/forum/?fromgroups=#!topic/sage-devel/OnhVtHXgdls ">this thread</a> and realized that I have to add an <em>axes_pad=0</em> parameter in order to get the correctly placed points. So the resuling work-around for a <em>loglog</em> scale would look like this:</p>
<pre><code>list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v', scale='loglog', axes_pad=0)
</code></pre>
http://ask.sagemath.org/question/9581/markers-in-list_plot/?answer=25527#post-id-25527You can use `scatter_plot` instead
sage: scatter_plot([(1,1),(2,2),(4,-1)],markersize=30,edgecolor=(1, 0, 0), marker='x')Thu, 15 Jan 2015 04:41:32 -0600http://ask.sagemath.org/question/9581/markers-in-list_plot/?answer=25527#post-id-25527Comment by kcrisman for <p>You can use <code>scatter_plot</code> instead </p>
<pre><code>sage: scatter_plot([(1,1),(2,2),(4,-1)],markersize=30,edgecolor=(1, 0, 0), marker='x')
</code></pre>
http://ask.sagemath.org/question/9581/markers-in-list_plot/?comment=25539#post-id-25539Nice. I think there is current work, maybe now merged, for this to work with `point()` as well.Thu, 15 Jan 2015 20:15:33 -0600http://ask.sagemath.org/question/9581/markers-in-list_plot/?comment=25539#post-id-25539