I am trying to use hexbin to plot some data on a square axis. I am using the following:
import matplotlib.cm as cm plt.figure() num_pts = 1000 x = rand(num_pts) * 100 y = rand(num_pts) * 250 x_min = 0 x_max = 150 x_step = 25 y_min = 50 y_max = 300 y_step = 50 s = plt.subplot(1,1,1) plt.hexbin(x,y,cmap=cm.jet,gridsize=20) plt.xticks(range(x_min,x_max+x_step,x_step)) plt.yticks(range(y_min,y_max+y_step,y_step))
I would like the axes to be square, and I want to set my own xticks / yticks and xy limits. there will be no data axes for some values, and therefore the calculations calculated using hexbin should be zero for them. I would like hexbin to construct this as an empty space, instead of leaving it βwhiteβ / blank if you use the cm.jet color palette.
Now I get it.
How can I get it to fill the empty space using its colormap? thanks. 
source share