I just added a new line property called "markevery" to support
subsampling markers. Included below is the docstring and nosetest
which should clearly indicate usage:
def set_markevery(self, every):
"""
Set the markevery property to subsample the plot when using
markers. Eg if ``markevery=5``, every 5-th marker will be
plotted. *every* can be
None
Every point will be plotted
an integer N
Every N-th marker will be plotted starting with marker 0
A length-2 tuple of integers
every=(start, N) will start at point start and plot every
N-th marker
ACCEPTS: None | integer | (startind, stride)
"""
def test_markevery():
x, y = np.random.rand(2, 100)
# check marker only plot
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x, y, 'o')
ax.plot(x, y, 'd', markevery=None)
ax.plot(x, y, 's', markevery=10)
ax.plot(x, y, '+', markevery=(5, 20))
fig.canvas.draw()
plt.close(fig)
# check line/marker combos
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x, y, '-o')
ax.plot(x, y, '-d', markevery=None)
ax.plot(x, y, '-s', markevery=10)
ax.plot(x, y, '-+', markevery=(5, 20))
fig.canvas.draw()
plt.close(fig)
···
On Tue, Dec 16, 2008 at 10:30 AM, John Hunter <jdh2358@...287...> wrote:
using in favour of matplotlib). Plotting the data twice- the first time
without
symbol showing every data point and the second time onlywith the symbol
and some skip in the data - doesn't help as I now get two entities in
the legend.
There is a way to do this, but it is not terribly elegant. The tricky
part is to get the legend right::