> Is there a text graphics module that does say scatter plots or > histograms? I'm thinking of stuff prior to the graphics era of > computing. I'm looking for something really simple.
Here's a quick and dirty way to do basic histogram of dice rolls: import random rolls={} for x in range(10000): a = [random.randint(1,10) for x in range(2)] v = sum(a) try: rolls[v] += 1 except KeyError: rolls[v] = 1 m = max(rolls.values()) stretch = (m/70.0) for x in rolls.keys(): print x, rolls[x], '*' * ( int(rolls[x] / stretch) ) _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor