I want to be able to specify the size of points in a

> scatter plot in data coordinates rather than points^2.

> The points should change in size at different zoom

> levels. Is there a built-in way to do this, or a good

> workaround for now?

You can't do this with the built-in scatter or RegularPolyCollection

(which scatter uses) because these assume a size in points. But you

can roll your own PolyCollection fairly easily

import matplotlib.cm as cm

import matplotlib.numerix as nx

from matplotlib.collections import PolyCollection

from pylab import figure, show

xs, ys, radii, colors = nx.mlab.rand(4,100)

radii *= 0.1

def poly(x,y,r,numsides):

theta = 2*nx.pi/numsides*nx.arange(numsides)

return zip(x + r*nx.cos(theta), y + r*nx.sin(theta))

verts = [poly(x,y,r,6) for x,y,r in zip(xs, ys, radii)]

col = PolyCollection(verts)

col.set_array(colors)

col.set_cmap(cm.hot)

fig = figure()

ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), aspect=1)

ax.add_collection(col)

show()