Parent Directory
|
Revision Log
Least squares model currently solves with SOLVE command, but not via GUI...
1 | # -*- coding: utf8 -*- |
2 | import extpy, sys |
3 | |
4 | try: |
5 | from pylab import * |
6 | except: |
7 | pass |
8 | |
9 | def leastsq_plot(self): |
10 | """Plot a least-squares fit, no added intermediate points though.""" |
11 | import loading |
12 | loading.load_matplotlib(throw=True) |
13 | |
14 | ioff() |
15 | figure() |
16 | |
17 | n = self.n.getIntValue() |
18 | |
19 | x = [] |
20 | y = [] |
21 | ye = [] |
22 | for i in range(n): |
23 | x.append(float(self.x[i+1])) |
24 | y.append(float(self.y[i+1])) |
25 | ye.append(float(self.f[i+1].y)) |
26 | plot(x,y,'bo') |
27 | plot(x,ye,'b-') |
28 | |
29 | extpy.getbrowser().reporter.reportNote("Plotting completed") |
30 | ion() |
31 | show() |
32 | |
33 | extpy.registermethod(leastsq_plot) |
34 |
john.pye@anu.edu.au | ViewVC Help |
Powered by ViewVC 1.1.22 |