Scattered symbols data

Hello,

I would like to know if it is possible to display the following feature
using matplotlib. Say that you have a 2D plot(x,y) with a lot of data. You
plot the data using a 2D solid line. Would be possible to add "some"
circles/squared or whatever to the solid line? When I say "some" I mean only
scattered values, otherwise given the quantity of data you would appreciate
the symbols.

Thanks,

Clear

···

--
View this message in context: http://old.nabble.com/Scattered-symbols-data-tp29173029p29173029.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

You can specify the parameter markevery=n to the plot to just plot every n-th marker. For example:

import matplotlib.pyplot as plt
import numpy as np
N = 10000
x = np.linspace(-10.0,10.0,N)
plt.plot(x,np.sin(x),"-s",markevery=N/50)
plt.show()

Regards,
Jo�o Lu�s

···

On 07/15/2010 02:36 PM, Clear wrote:

Hello,

I would like to know if it is possible to display the following feature
using matplotlib. Say that you have a 2D plot(x,y) with a lot of data. You
plot the data using a 2D solid line. Would be possible to add "some"
circles/squared or whatever to the solid line? When I say "some" I mean only
scattered values, otherwise given the quantity of data you would appreciate
the symbols.

Thanks,

Clear

plt.plot(x,np.sin(x),"-s",markevery=N/50)

I have tried your option but a message is returned to me which says that
markevery is an unknown property. I have included exactly the code you
propose. May I guess why I am getting such error?

Clear

···

--
View this message in context: http://old.nabble.com/Scattered-symbols-data-tp29204418p29205124.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Are you sure you ran the example as I sent it? markevery should be available since matplotlib version 0.98.5.2, released at the end of 2008. Which mpl version and operating system are you using?

JLS

···

On 07/19/2010 03:11 PM, Clear wrote:

plt.plot(x,np.sin(x),"-s",markevery=N/50)

I have tried your option but a message is returned to me which says that
markevery is an unknown property. I have included exactly the code you
propose. May I guess why I am getting such error?

Clear

My MPL version is '0.98.5.2' and my OS is Ubuntu 9.04. I tried again but it
is still giving me that error. Weird.

João Luís Silva-2 wrote:

···

On 07/19/2010 03:11 PM, Clear wrote:

plt.plot(x,np.sin(x),"-s",markevery=N/50)

I have tried your option but a message is returned to me which says that
markevery is an unknown property. I have included exactly the code you
propose. May I guess why I am getting such error?

Clear

Are you sure you ran the example as I sent it? markevery should be
available since matplotlib version 0.98.5.2, released at the end of
2008. Which mpl version and operating system are you using?

JLS

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
View this message in context: http://old.nabble.com/Scattered-symbols-data-tp29204418p29205784.html
Sent from the matplotlib - users mailing list archive at Nabble.com.