Fits the curve y = a*(1-b*exp((-4*D)*(x/a)*c)) to the x- and y data.
The parameters have the follow meaning:

@param xdata
@param ydata
553000
public void doFit(double[] xdata, double[] ydata, boolean reduced){
			CurveFitter fitter = new CurveFitter(xdata, ydata);
			if(reduced==false){
				double ia = Double.isNaN(initA)?0:initA;
				double ib = Double.isNaN(initB)?0:initB;
				double ic = Double.isNaN(initC)?0:initC;
				double id = Double.isNaN(initD)?0:initD;
				double[] initialParams = new double[]{ia,ib,ic,id};//,regest.evaluate()[0]};
				fitter.setInitialParameters(initialParams);
				//fitter.doCustomFit("y=a*(1-b*exp(-4*c*d*x/a))", initialParams, false);
				fitter.doCustomFit("y=sqrt(a*a)*(1-sqrt(b*b)*exp(-4*sqrt(c*c)*sqrt(d*d)*x/sqrt(a*a)))", initialParams, false);
				double[] params = fitter.getParams();
				a = Math.abs(params[0]);
				b = Math.abs(params[1]);
				c = Math.abs(params[2]);
				D = Math.abs(params[3]);
				goodness = fitter.getFitGoodness();
			}else{
				double ia = Double.isNaN(initA)?0:initA;
				double id = Double.isNaN(initD)?0:initD;
				double[] initialParams = new double[]{ia,id};//,regest.evaluate()[0]};
				fitter.setInitialParameters(initialParams);
				//fitter.doCustomFit("y=a*(1-b*exp(-4*c*d*x/a))", initialParams, false);
				fitter.doCustomFit("y=sqrt(a*a)*(1-exp(-4*sqrt(b*b)*x/sqrt(a*a)))", initialParams, false);
				double[] params = fitter.getParams();
				a = Math.abs(params[0]);
				D = Math.abs(params[1]);
				goodness = fitter.getFitGoodness();
			}
	}
1336846
def line_math(fx=None, fy=None, axes='gca'):
    

    if axes=='gca': axes = _pylab.gca()

    lines = axes.get_lines()

    for line in lines:
        if isinstance(line, _mpl.lines.Line2D):
            xdata, ydata = line.get_data()
            if not fx==None: xdata = fx(xdata)
            if not fy==None: ydata = fy(ydata)
            line.set_data(xdata,ydata)

    _pylab.draw()
690784
def plot(self, xdata, ydata, side='left', title=None,
             xlabel=None, ylabel=None, y2label=None,
             use_dates=False, **kws):
        
        allaxes = self.fig.get_axes()
        if len(allaxes) > 1:
            for ax in allaxes[1:]:
                if ax in self.data_range:
                    self.data_range.pop(ax)
                self.fig.delaxes(ax)

        self.data_range = {}
        self.conf.zoom_lims = []
        self.conf.axes_traces = {}
        self.clear()
        axes = self.axes
        if side == 'right':
            axes = self.get_right_axes()
        self.conf.ntrace  = 0
        self.conf.yscale = 'linear'
        self.conf.user_limits[axes] = [None, None, None, None]

        if xlabel is not None:
            self.set_xlabel(xlabel, delay_draw=True)
        if ylabel is not None:
            self.set_ylabel(ylabel, delay_draw=True)
        if y2label is not None:
            self.set_y2label(y2label, delay_draw=True)
        if title is not None:
            self.set_title(title, delay_draw=True)
        if use_dates is not None:
            self.use_dates  = use_dates
        return self.oplot(xdata, ydata, side=side, **kws)
578568
def _get_xdata_for_function(self, n, xdata):
        
        
        # Use the xdata itself for the function
        if self['fpoints'][n] in [None, 0]: return _n.array(xdata)
            
        # Otherwise, generate xdata with the number of fpoints
        
        # do exponential ranging if xscale is log
        if self['xscale'][n] == 'log':
            return _n.logspace(_n.log10(min(xdata)), _n.log10(max(xdata)),
                               self['fpoints'][n], True, 10.0)
        
        # otherwise do linear spacing
        else:
            return _n.linspace(min(xdata), max(xdata), self['fpoints'][n])
96892
function(x,y){
        x[y>>5] |= 0x80<<((y)%32);
        x[(((y+64)>>>9)<<4)+14] = y;
        var a = 1732584193,
            b = -271733879,
            c = -1732584194,
            d = 271733878;
        for(var i=0,l=x.length,_oa,_ob,_oc,_od;i<l;i+=16){
            _oa = a; _ob = b; _oc = c; _od = d;
            a = __md5ff(a, b, c, d, x[i+ 0], 7 , -680876936);
            d = __md5ff(d, a, b, c, x[i+ 1], 12, -389564586);
            c = __md5ff(c, d, a, b, x[i+ 2], 17,  606105819);
            b = __md5ff(b, c, d, a, x[i+ 3], 22, -1044525330);
            a = __md5ff(a, b, c, d, x[i+ 4], 7 , -176418897);
            d = __md5ff(d, a, b, c, x[i+ 5], 12,  1200080426);
            c = __md5ff(c, d, a, b, x[i+ 6], 17, -1473231341);
            b = __md5ff(b, c, d, a, x[i+ 7], 22, -45705983);
            a = __md5ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
            d = __md5ff(d, a, b, c, x[i+ 9], 12, -1958414417);
            c = __md5ff(c, d, a, b, x[i+10], 17, -42063);
            b = __md5ff(b, c, d, a, x[i+11], 22, -1990404162);
            a = __md5ff(a, b, c, d, x[i+12], 7 ,  1804603682);
            d = __md5ff(d, a, b, c, x[i+13], 12, -40341101);
            c = __md5ff(c, d, a, b, x[i+14], 17, -1502002290);
            b = __md5ff(b, c, d, a, x[i+15], 22,  1236535329);
            a = __md5gg(a, b, c, d, x[i+ 1], 5 , -165796510);
            d = __md5gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
            c = __md5gg(c, d, a, b, x[i+11], 14,  643717713);
            b = __md5gg(b, c, d, a, x[i+ 0], 20, -373897302);
            a = __md5gg(a, b, c, d, x[i+ 5], 5 , -701558691);
            d = __md5gg(d, a, b, c, x[i+10], 9 ,  38016083);
            c = __md5gg(c, d, a, b, x[i+15], 14, -660478335);
            b = __md5gg(b, c, d, a, x[i+ 4], 20, -405537848);
            a = __md5gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
            d = __md5gg(d, a, b, c, x[i+14], 9 , -1019803690);
            c = __md5gg(c, d, a, b, x[i+ 3], 14, -187363961);
            b = __md5gg(b, c, d, a, x[i+ 8], 20,  1163531501);
            a = __md5gg(a, b, c, d, x[i+13], 5 , -1444681467);
            d = __md5gg(d, a, b, c, x[i+ 2], 9 , -51403784);
            c = __md5gg(c, d, a, b, x[i+ 7], 14,  1735328473);
            b = __md5gg(b, c, d, a, x[i+12], 20, -1926607734);
            a = __md5hh(a, b, c, d, x[i+ 5], 4 , -378558);
            d = __md5hh(d, a, b, c, x[i+ 8], 11, -2022574463);
            c = __md5hh(c, d, a, b, x[i+11], 16,  1839030562);
            b = __md5hh(b, c, d, a, x[i+14], 23, -35309556);
            a = __md5hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
            d = __md5hh(d, a, b, c, x[i+ 4], 11,  1272893353);
            c = __md5hh(c, d, a, b, x[i+ 7], 16, -155497632);
            b = __md5hh(b, c, d, a, x[i+10], 23, -1094730640);
            a = __md5hh(a, b, c, d, x[i+13], 4 ,  681279174);
            d = __md5hh(d, a, b, c, x[i+ 0], 11, -358537222);
            c = __md5hh(c, d, a, b, x[i+ 3], 16, -722521979);
            b = __md5hh(b, c, d, a, x[i+ 6], 23,  76029189);
            a = __md5hh(a, b, c, d, x[i+ 9], 4 , -640364487);
            d = __md5hh(d, a, b, c, x[i+12], 11, -421815835);
            c = __md5hh(c, d, a, b, x[i+15], 16,  530742520);
            b = __md5hh(b, c, d, a, x[i+ 2], 23, -995338651);
            a = __md5ii(a, b, c, d, x[i+ 0], 6 , -198630844);
            d = __md5ii(d, a, b, c, x[i+ 7], 10,  1126891415);
            c = __md5ii(c, d, a, b, x[i+14], 15, -1416354905);
            b = __md5ii(b, c, d, a, x[i+ 5], 21, -57434055);
            a = __md5ii(a, b, c, d, x[i+12], 6 ,  1700485571);
            d = __md5ii(d, a, b, c, x[i+ 3], 10, -1894986606);
            c = __md5ii(c, d, a, b, x[i+10], 15, -1051523);
            b = __md5ii(b, c, d, a, x[i+ 1], 21, -2054922799);
            a = __md5ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
            d = __md5ii(d, a, b, c, x[i+15], 10, -30611744);
            c = __md5ii(c, d, a, b, x[i+ 6], 15, -1560198380);
            b = __md5ii(b, c, d, a, x[i+13], 21,  1309151649);
            a = __md5ii(a, b, c, d, x[i+ 4], 6 , -145523070);
            d = __md5ii(d, a, b, c, x[i+11], 10, -1120210379);
            c = __md5ii(c, d, a, b, x[i+ 2], 15,  718787259);
            b = __md5ii(b, c, d, a, x[i+ 9], 21, -343485551);
            a = __add(a, _oa);
            b = __add(b, _ob);
            c = __add(c, _oc);
            d = __add(d, _od);
        }   return [a, b, c, d];
    }
242877
def smooth_data(xdata, ydata, yerror, amount=1):
    

    new_xdata  = smooth_array(_n.array(xdata), amount)
    new_ydata  = smooth_array(_n.array(ydata), amount)
    if yerror is None:  new_yerror = None
    else:               new_yerror = smooth_array(_n.array(yerror), amount)

    return [new_xdata, new_ydata, new_yerror]
22384
def scatter_nb(self,xdata,ydata=[],trendline=False):
        ''''''
        self.scatter(xdata,ydata,trendline)
611118
function(x, y) {
        var imageData = this._context.getImageData(x, y, 1, 1);
        var data = imageData.data;
        return data[3] === 0;
    }
1361765
function (inData, outData, width, height, options) {
        options = defaultOptions(options, {amount: 1, angle: 0});
        var i, n = width * height * 4,
            amount = options.amount,
            angle = options.angle,
            x = Math.cos(-angle) * amount,
            y = Math.sin(-angle) * amount,

            a00 = -x - y,
            a10 = -x,
            a20 = y - x,
            a01 = -y,
            a21 = y,
            a02 = -y + x,
            a12 = x,
            a22 = y + x,

            tmpData = [];

        convolve3x3(inData, tmpData, width, height,
            [
                [a00, a01, a02],
                [a10, 0, a12],
                [a20, a21, a22]
            ]);

        for (i = 0; i < n; i += 4) {
            outData[i] = 128 + tmpData[i];
            outData[i + 1] = 128 + tmpData[i + 1];
            outData[i + 2] = 128 + tmpData[i + 2];
            outData[i + 3] = inData[i + 3];
        }
    }
209895
def fit(self, X, y=None, **kwargs):
        
        # TODO: decide to use this method or the score method to draw.
        # NOTE: Probably this would be better in score, but the standard score
        # is a little different and I'm not sure how it's used.

        # Fit the wrapped estimator
        self.estimator.fit(X, y, **kwargs)

        # Get the properties of the dataset
        self.n_samples_ = X.shape[0]
        self.n_clusters_ = self.estimator.n_clusters

        # Compute the scores of the cluster
        labels = self.estimator.predict(X)
        self.silhouette_score_ = silhouette_score(X, labels)
        self.silhouette_samples_ = silhouette_samples(X, labels)

        # Draw the silhouette figure
        self.draw(labels)

        # Return the estimator
        return self
1166594
function(x, y) {
		var offset = (x + y * this.width) * 4;
	
		return [
			this.data[offset + 0],
			this.data[offset + 1],
			this.data[offset + 2],
			this.data[offset + 3]
		];
	}
324341
private void fitParameters(Map<Long, Double> metricData) {
        mean = getMetricMean(metricData);
        variance = getMetricVariance(metricData);
    }
1322740
function updateTimeProgression(curve, x, y) {
        var percentX = Math.round(100 * x / WIDTH_MAIN),
            percentY = Math.round(100 * ((HEIGHT_MAIN - y) / HEIGHT_MAIN));

        // Constrain horizontal percentage to [0, 100] range
        percentX = Math.min(Math.max(0, percentX), 100);

        curve.parentNode.setAttribute("data-time", percentX);
        curve.parentNode.setAttribute("data-progression", percentY);
    }
952882
public BubbleSeries addSeries(
      String seriesName,
      List<? extends Number> xData,
      List<? extends Number> yData,
      List<? extends Number> bubbleData) {

    return addSeries(
        seriesName,
        Utils.getDoubleArrayFromNumberList(xData),
        Utils.getDoubleArrayFromNumberList(yData),
        Utils.getDoubleArrayFromNumberList(bubbleData));
  }
610235
public void setXY(double x, double y) {
		_touch();

		if (m_attributes == null)
			_setToDefault();

		m_attributes[0] = x;
		m_attributes[1] = y;
	}
348456
function(x, y, tileData){
            var light = this.ambientLight;
            var lighting = this.get(x, y);

            var overlay = function(c1, c2){
                var out = c1.slice();
                for (var i = 0; i < 3; i++) {
                    var a = c1[i],
                        b = c2[i];
                    if(b < 128){
                        out[i] = Math.round(2 * a * b / 255);
                    } else {
                        out[i] = Math.round(255 - 2 * (255 - a) * (255 - b) / 255);
                    }
                }
                return out;
            };

            if(lighting){
                light = ROT.Color.add(this.ambientLight, lighting);
            }

            if(tileData.color){
                var color = ROT.Color.fromString(tileData.color);
                color = overlay(light, color);
                tileData.color = ROT.Color.toRGB(color);
            }

            if(tileData.bgColor){
                var bgColor = ROT.Color.fromString(tileData.bgColor);
                bgColor = overlay(light, bgColor);
                tileData.bgColor = ROT.Color.toRGB(bgColor);
            }
            return tileData;
        }
1164104
def fit(self, X, y, **kwargs):
        
        self.estimator.fit(X, y, **kwargs)
        self.draw()
        return self