Commit cec599b4 authored by Matheus Müller's avatar Matheus Müller

Distribuicao agora impressa em arquivo de nome selecionado

parent 2b5e5b35
...@@ -6,12 +6,16 @@ from scipy.interpolate import interp1d ...@@ -6,12 +6,16 @@ from scipy.interpolate import interp1d
from scipy import interpolate from scipy import interpolate
from pylab import * from pylab import *
import Tkinter as tk import Tkinter as tk
#import pickle
listay = list() listay = list()
listax = list()
drs = [] drs = []
fig = plt.figure() fig = plt.figure()
ax = fig.add_subplot(111) ax = fig.add_subplot(111)
recursivecontrol = 0 recursivecontrol = 0
filename = raw_input()
####################################################################################################### #######################################################################################################
# Add square # Add square
...@@ -24,6 +28,7 @@ def add_square(x): ...@@ -24,6 +28,7 @@ def add_square(x):
dr.connect() dr.connect()
drs.append(dr) drs.append(dr)
listay.append(dr.rect.xy[1]) listay.append(dr.rect.xy[1])
listax.append(dr.rect.xy[0])
ylim([0,1]) ylim([0,1])
xlim([0,20]) xlim([0,20])
...@@ -148,9 +153,18 @@ class DraggableRectangle: ...@@ -148,9 +153,18 @@ class DraggableRectangle:
self.rect.figure.canvas.draw() self.rect.figure.canvas.draw()
for i in range(len(listay)): for i in range(len(listay)):
listay[i] = drs[i].rect.xy (listax[i], listay[i]) = drs[i].rect.xy
#pickle.dump(" ", data)
#pickle.dump(listay[i], data)
print listax, listay
data = open(filename , 'w')
for i in range(len(listay)):
print>>data, listax[i], listay[i]
#data.write("(%s, %s)" %(str(listax[i]), str(listay[i])) )
#dot_pickle = pickle.dumps(listay)
print listay
def disconnect(self): def disconnect(self):
'disconnect all the stored connection ids' 'disconnect all the stored connection ids'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment