Given the desire to draw squares with area h**2 and a color based on the value in d, you could draw rectangles using matplotlib with a color obtained from a colormap (scaled to 0-1):
import pylab
import numpy as np
import matplotlib as mpl
import random
import matplotlib.cm as cm
my_cmap = cm.bone
def my_square_scatter(axes, x_array, y_array, size_array, color_array):
for x, y, size, color in zip(x_array, y_array, size_array, color_array):
square = pylab.Rectangle((x-size/2,y-size/2), size, size, facecolor = my_cmap(color))
axes.add_patch(square)
return True
x = np.arange(100)
y = np.arange(100)
random.shuffle(y)
h = np.arange(100)/10.0
d = np.arange(100)/100.0
random.shuffle(d)
fig = pylab.figure(1)
fig.clf()
axes = pylab.axes()
my_square_scatter(axes, x, y, h, d)
pylab.axis('scaled')
#Create your own colorbar based on the parent axes.
ax, _ = mpl.colorbar.make_axes(axes)
cbar = mpl.colorbar.ColorbarBase(ax, cmap=my_cmap, norm=mpl.colors.Normalize(vmin=0.0, vmax=1.0))
#cbar.set_clim(0.0,1.0) #Scale the colorbar; default is 0--1
pylab.show()
Sample output:

Your d array should be normalized to 0-1. Otherwise you should scale this in the color selection.
Adapted from Plot/scatter position and marker size in the same coordinates.