Honestly, I can't even remember why it is wrapped. I think this is just a
relic of some old example that I had lying around. Serves me right for just
copying and pasting without thinking :P . A straight call to
itertools.cycle is definitely much cleaner. Also, is there an example of
this in the
On Fri, Nov 5, 2010 at 8:07 AM, Aman Thakral wrote:
> Hi,
>
> The best way to do this is to use a generator:
>
> import itertools
> import matplotlib.pyplot as plt
> import numpy as np
>
> def _ncycle(iterable,n):
> """
> Method to create a generator from an iterable. It keeps the
> c
>
> How can I automatically cycle through distinctive line markers?
>>
>> I want a semilog plot, composed of a number of lines. Each line should
>> have
>> a different color and marker.
>
>
I simply use:
colors = ['b', 'r', 'c', 'm', 'k', 'g', 'y']
symbols = ['-', '--', '-.', ':']
nc = len(colors
Hi,
The best way to do this is to use a generator:
import itertools
import matplotlib.pyplot as plt
import numpy as np
def _ncycle(iterable,n):
"""
Method to create a generator from an iterable. It keeps the
current position of the iterable in memory. Each time the
next() metho
How can I automatically cycle through distinctive line markers?
I want a semilog plot, composed of a number of lines. Each line should have
a different color and marker.
Cycling through the colors is automatic, but not the markers.
BTW, shouldn't this behavior be the default? I would just lik