How to have few marks on the lines?

Hi,

I am a wondering if it’s possible to have few line distinguishing marks on the data lines on a chart such as circle, start, square. When I use some thing like this for the color of the graph (i.e. rs, k^), it uses the shape for each data point and the lines becomes very thick. All I want is to put 4-5 shaper markers on each line with line (the data line will have few hundred data points).

Many thanks,

Omer

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot

use *markevery* keyword.

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.lines.Line2D.set_markevery

If you want more control, you can always draws the lines (without
markers) first and overplot markers in positions you want separately.

Regards,

-JJ

···

On Wed, May 19, 2010 at 11:56 AM, Omer Khalid <Omer.Khalid@...1758...> wrote:

Hi,
I am a wondering if it's possible to have few line distinguishing marks on
the data lines on a chart such as circle, start, square. When I use some
thing like this for the color of the graph (i.e. rs, k^), it uses the shape
for each data point and the lines becomes very thick. All I want is to put
4-5 shaper markers on each line with line (the data line will have few
hundred data points).
Many thanks,
Omer
------------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Hi Jae,

Thanks for your reply and letting me know about this. Can you please point me to some code example?

Cheers,
Omer

···

On Thu, May 20, 2010 at 20:38, Jae-Joon Lee <lee.j.joon@…287…> wrote:

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot

use markevery keyword.

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.lines.Line2D.set_markevery

If you want more control, you can always draws the lines (without

markers) first and overplot markers in positions you want separately.

Regards,

-JJ

On Wed, May 19, 2010 at 11:56 AM, Omer Khalid <Omer.Khalid@…1758…> wrote:

Hi,

I am a wondering if it’s possible to have few line distinguishing marks on

the data lines on a chart such as circle, start, square. When I use some

thing like this for the color of the graph (i.e. rs, k^), it uses the shape

for each data point and the lines becomes very thick. All I want is to put

4-5 shaper markers on each line with line (the data line will have few

hundred data points).

Many thanks,

Omer



Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

In [226]: t = np.arange(0, 2, 0.05)

In [227]: s = np.sin(2*np.pi*t)

In [228]: plot(t, s, '-')
Out[228]: [<matplotlib.lines.Line2D object at 0x9ef1fcc>]

Approach 1:

In [229]: plot(t, s, 'o', markevery=10)
Out[229]: [<matplotlib.lines.Line2D object at 0x9eb932c>]

Approach 2:

In [230]: plot(t[::5], s[::5], 's')
Out[230]: [<matplotlib.lines.Line2D object at 0x1431f30c>]

···

On Tue, May 25, 2010 at 6:46 AM, Omer Khalid <Omer.Khalid@...1758...> wrote:

Hi Jae,
Thanks for your reply and letting me know about this. Can you please point
me to some code example?

Hi John,

Thanks a lot for the example code; it answered my question.

Best Regards,

Omer

···

On Tue, May 25, 2010 at 14:25, John Hunter <jdh2358@…1003…7…> wrote:

On Tue, May 25, 2010 at 6:46 AM, Omer Khalid <Omer.Khalid@…1758…> wrote:

Hi Jae,

Thanks for your reply and letting me know about this. Can you please point

me to some code example?

In [226]: t = np.arange(0, 2, 0.05)

In [227]: s = np.sin(2np.pit)

In [228]: plot(t, s, ‘-’)

Out[228]: [<matplotlib.lines.Line2D object at 0x9ef1fcc>]

Approach 1:

In [229]: plot(t, s, ‘o’, markevery=10)

Out[229]: [<matplotlib.lines.Line2D object at 0x9eb932c>]

Approach 2:

In [230]: plot(t[::5], s[::5], ‘s’)

Out[230]: [<matplotlib.lines.Line2D object at 0x1431f30c>]