>>>>> "Michael" == Michael J T O'Kelly <[EMAIL PROTECTED]> writes:

    Michael> I want to be able to specify the size of points in a
    Michael> scatter plot in data coordinates rather than points^2.
    Michael> The points should change in size at different zoom
    Michael> levels.  Is there a built-in way to do this, or a good
    Michael> 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()

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to