mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-03 08:42:39 +02:00
xrange fixes for Python 3
This commit is contained in:
parent
5eeb2f18e9
commit
cf1c382acd
14 changed files with 29 additions and 29 deletions
|
|
@ -50,8 +50,8 @@ def plot_2D_images(figure, arr, symmetric=False, pad=None, zoom=None, mode=None,
|
|||
|
||||
buf = np.ones((y_size*fig_nrows+pad*(fig_nrows-1), x_size*fig_ncols+pad*(fig_ncols-1), 3),dtype=arr.dtype)
|
||||
|
||||
for y in xrange(fig_nrows):
|
||||
for x in xrange(fig_ncols):
|
||||
for y in range(fig_nrows):
|
||||
for x in range(fig_ncols):
|
||||
if y*fig_ncols+x<fig_num:
|
||||
buf[y*y_size+y*pad:(y+1)*y_size+y*pad, x*x_size+x*pad:(x+1)*x_size+x*pad] = arr_color[y*fig_ncols+x,:,:,:3]
|
||||
img_plot = ax.imshow(buf, interpolation=interpolation)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ def plot(shape_records,facecolor='w',edgecolor='k',linewidths=.5, ax=None,xlims=
|
|||
par = list(sparts) + [points.shape[0]]
|
||||
|
||||
polygs = []
|
||||
for pj in xrange(len(sparts)):
|
||||
for pj in range(len(sparts)):
|
||||
polygs.append(Polygon(points[par[pj]:par[pj+1]]))
|
||||
ax.add_collection(PatchCollection(polygs,facecolor=facecolor,edgecolor=edgecolor, linewidths=linewidths))
|
||||
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ class mocap_data_show(matplotlib_show):
|
|||
|
||||
def initialize_axes(self, boundary=0.05):
|
||||
"""Set up the axes with the right limits and scaling."""
|
||||
bs = [(self.vals[:, i].max()-self.vals[:, i].min())*boundary for i in xrange(3)]
|
||||
bs = [(self.vals[:, i].max()-self.vals[:, i].min())*boundary for i in range(3)]
|
||||
self.x_lim = np.array([self.vals[:, 0].min()-bs[0], self.vals[:, 0].max()+bs[0]])
|
||||
self.y_lim = np.array([self.vals[:, 1].min()-bs[1], self.vals[:, 1].max()+bs[1]])
|
||||
self.z_lim = np.array([self.vals[:, 2].min()-bs[2], self.vals[:, 2].max()+bs[2]])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue