From 070a839611742ed20044ca4d884f06e95a8e3a60 Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Fri, 17 Jul 2015 12:39:08 -0400 Subject: [PATCH 1/3] mep12 on scatter_profile.py --- examples/pylab_examples/scatter_profile.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/pylab_examples/scatter_profile.py b/examples/pylab_examples/scatter_profile.py index 4bf68dbdd76c..49d93d611c26 100755 --- a/examples/pylab_examples/scatter_profile.py +++ b/examples/pylab_examples/scatter_profile.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python -# -*- noplot -*- - """ N Classic Base renderer Ext renderer 20 0.22 0.14 0.14 @@ -9,16 +6,16 @@ 10000 3.30 1.31 0.53 50000 19.30 6.53 1.98 """ -from __future__ import print_function -import pylab +from __future__ import print_function # only needed for python 2.x +import matplotlib.pyplot as plt +import numpy as np import time - for N in (20, 100, 1000, 10000, 50000): tstart = time.time() - x = 0.9*pylab.rand(N) - y = 0.9*pylab.rand(N) - s = 20*pylab.rand(N) - pylab.scatter(x, y, s) + x = 0.9*np.rand(N) + y = 0.9*np.rand(N) + s = 20*np.rand(N) + plt.scatter(x, y, s) print('%d symbols in %1.2f s' % (N, time.time() - tstart)) From 6e4127440c4d114cf1c8af2cfc7dca34419f702b Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Sun, 19 Jul 2015 08:48:39 -0400 Subject: [PATCH 2/3] bug fixes on scatter_profile.py --- examples/pylab_examples/scatter_profile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pylab_examples/scatter_profile.py b/examples/pylab_examples/scatter_profile.py index 49d93d611c26..008c477829e8 100755 --- a/examples/pylab_examples/scatter_profile.py +++ b/examples/pylab_examples/scatter_profile.py @@ -14,8 +14,8 @@ for N in (20, 100, 1000, 10000, 50000): tstart = time.time() - x = 0.9*np.rand(N) - y = 0.9*np.rand(N) - s = 20*np.rand(N) + x = 0.9*np.random.random(N) + y = 0.9*np.random.random(N) + s = 20*np.random.random(N) plt.scatter(x, y, s) print('%d symbols in %1.2f s' % (N, time.time() - tstart)) From 0ab33ccb8a502fd9caad7baa1e01e4083199d3c1 Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Sun, 19 Jul 2015 17:30:09 -0400 Subject: [PATCH 3/3] Bug fix --- examples/pylab_examples/scatter_profile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pylab_examples/scatter_profile.py b/examples/pylab_examples/scatter_profile.py index 008c477829e8..8092f3bc171b 100755 --- a/examples/pylab_examples/scatter_profile.py +++ b/examples/pylab_examples/scatter_profile.py @@ -14,8 +14,8 @@ for N in (20, 100, 1000, 10000, 50000): tstart = time.time() - x = 0.9*np.random.random(N) - y = 0.9*np.random.random(N) - s = 20*np.random.random(N) + x = 0.9*np.random.rand(N) + y = 0.9*np.random.rand(N) + s = 20*np.random.rand(N) plt.scatter(x, y, s) print('%d symbols in %1.2f s' % (N, time.time() - tstart))