<commit_before>import matplotlib.pyplot as plt
import numpy as np
import gtk.gdk as gdk

def tile():
	"""Tiles open figures."""

	figs=plt.get_fignums()

	# Keep track of x,y,size for figures
	x=0
	y=0
	size=np.array([0,0])
	maxy=0
	toppad = 21

	if ( len(figs) != 0 ):
		fig=plt.figure(figs[0])
		screen=fig.canvas.window.get_screen()
		screenx = screen.get_monitor_geometry(screen.get_primary_monitor())
		screenx = screenx[2]
	
	for fig in figs:
		fig = plt.figure(fig)
		size=np.array(fig.canvas.manager.window.get_size())
		if ( x+size[0] > screenx ):
			x=0
			y=maxy
			maxy= y+size[1]+toppad
		else:
			maxy = max(maxy,y+size[1]+toppad)
		fig.canvas.manager.window.move(x,y)
		x += size[0] + 1
	
if __name__ == "__main__":
	tile()<commit_msg>Updated tile.py to work with 2 monitors.<commit_after>import matplotlib.pyplot as plt
import numpy as np
import gtk.gdk as gdk

def tile():
	"""Tiles open figures."""

	figs=plt.get_fignums()

	# Keep track of x,y,size for figures
	x       = 0
	y       = 0
	# maxy    = 0
	toppad  = 21

	size=np.array([0,0])

	if ( len(figs) != 0 ):
		fig=plt.figure(figs[0])
		screen=fig.canvas.window.get_screen()
		screenx = screen.get_monitor_geometry(screen.get_primary_monitor())
		screenx = screenx[2]
	
		fig = plt.figure(figs[0])
		fig.canvas.manager.window.move(x,y)
		maxy = np.array(fig.canvas.manager.window.get_position())[1]
		size=np.array(fig.canvas.manager.window.get_size())
		y = maxy
		x += size[0]+1
	
		for fig in figs[1:]:
			fig = plt.figure(fig)
			size=np.array(fig.canvas.manager.window.get_size())
			if ( x+size[0] > screenx ):
				x=0
				y=maxy
				maxy= y+size[1]+toppad
			else:
				maxy = max(maxy,y+size[1]+toppad)
			fig.canvas.manager.window.move(x,y)
			x += size[0] + 1
	
if __name__ == "__main__":
	tile()
{'fraction_non_alphanumeric': 0.1601123595505618, 'fraction_numerical': 0.021348314606741574, 'mean_word_length': 3.602067183462532, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3049210', 'n_tokens_mistral': 820, 'n_tokens_neox': 749, 'n_words': 146}