Plots function

        :param func: function to plot
        :param mins: minimum of values (x, y ...)
        :param maxs: maximum of values (x, y ...)
        :param precision: precision to plot
        :param kind: kind of plot, "slice", "countour"
970457
def plot_type(self, func, mins, maxs, precision, kind):
        

        min_x, min_y, min_z = mins[0], mins[1], mins[2]
        max_x, max_y, max_z = maxs[0], maxs[1], maxs[2]

        def set_labels(graph, label_x, label_y, label_z):
            """Sets given labels to axes of graph

            :param graph: plot
            :param label_x: new label on x axis
            :param label_y: new label on y axis
            :param label_z: new label on z axis
            """
            graph.set_xlabel(label_x)
            graph.set_ylabel(label_y)
            graph.set_zlabel(label_z)

        def set_limits(graph):
            """Set chart limits to axes of graph

            :param graph: plot
            """
            graph.set_xlim(min_x, max_x)
            graph.set_ylim(min_y, max_y)
            graph.set_zlim(min_z, max_z)

        def get_precision(min_val, max_val):
            """Calculates precision

            :param min_val: minimum
            :param max_val: maximum
            :return: precision: prevision of values
            """
            return int((max_val - min_val) * (1 + precision))

        def get_precision_delta(min_val, max_val):
            """Calculates precision delta

            :param min_val: minimum
            :param max_val: maximum
            :return: delta: Precision delta
            """
            return float(max_val - min_val) / float(10 * precision)

        def plot_slice():
            """ Plots slice

            :return: shows plot
            """
            chart = plt.axes(projection="3d")  # general settings
            points_x = get_precision(min_x, max_x)
            points_y = get_precision(min_y, max_z)

            x_axis = numpy.outer(linspace(min_x, max_x, points_x), points_x)
            y_axis = numpy.outer(
                linspace(min_y, max_y, points_y).flatten(), points_y
            ).T

            def update(val):
                """Updates chart with value

                :param val: value
                """
                chart.clear()
                x_const = slider.val
                z_axis = func(x_const, x_axis, y_axis)
                chart.plot_surface(
                    x_axis, y_axis, z_axis, alpha=0.3, linewidth=2.0
                )
                set_labels(chart, "y", "z", "w")

            # slider
            axis_slider = plt.axes([0.12, 0.03, 0.78, 0.03], axisbg="white")
            slider = Slider(axis_slider, "x", min_x, max_x, valinit=min_x)

            slider.on_changed(update)
            set_limits(chart)
            self.show_plot()

            slider.on_changed(update)
            set_labels(chart, "y", "z", "w")

        def plot_countour():
            """Plots countour
            """
            # general settings
            fig = plt.figure()
            chart = fig.gca(projection="3d")

            # create axes
            x_axis = numpy.arange(min_x, max_x, get_precision_delta(
                min_x, max_x)).tolist()
            y_axis = numpy.arange(min_y, max_y, get_precision_delta(
                min_y, max_y)).tolist()
            x_axis, y_axis = numpy.meshgrid(x_axis, y_axis)

            def update(val):
                """Updates chart with value

                :param val: value
                """
                chart.clear()  # re-plot
                x_const = slider.val
                z_axis = []

                # add new points
                for i, _ in enumerate(x_axis):
                    z_axis.append(func(x_const, x_axis[i], y_axis[i]))

                # show
                chart.contour(
                    x_axis, y_axis, z_axis, zdir="x", offset=min_x
                )
                chart.contour(
                    x_axis, y_axis, z_axis, zdir="y", offset=min_y
                )
                chart.contour(
                    x_axis, y_axis, z_axis, zdir="z", offset=min_z
                )
                chart.contour(x_axis, y_axis, z_axis, extend3d=True)
                set_labels(chart, "y", "z", "w")

            # slider
            axis_slider = plt.axes([0.12, 0.03, 0.78, 0.03], axisbg="white")
            slider = Slider(axis_slider, "x", min_x, max_x, valinit=min_x)

            slider.on_changed(update)
            set_limits(chart)

        if kind == "slice":
            plot_slice()
        elif kind == "countour":
            plot_countour()

        self.show_plot()
1299825
def customize(func):
    
    @wraps(func)
    def call_w_context(*args, **kwargs):
        set_context = kwargs.pop('set_context', True)
        if set_context:
            color_palette = sns.color_palette('colorblind')
            with plotting_context(), axes_style(), color_palette:
                sns.despine(left=True)
                return func(*args, **kwargs)
        else:
            return func(*args, **kwargs)
    return call_w_context
967003
def set_function(self, f):
        

        def samples(self):
            return (('', {}, float(f())),)

        self._child_samples = types.MethodType(samples, self)
352551
function (actualValueKey, options) {
  return function (bytes) {
    var result = {};

    result['min_' + actualValueKey] = options.min_actual || 0;
    result['max_' + actualValueKey] = options.max_actual;
    result[actualValueKey] = misc.scaleValue(misc.bufferToInt(bytes), options);

    return result;
  };
}
227094
def xlim(self, low, high):
        
        self.chart['xAxis'][0]['min'] = low
        self.chart['xAxis'][0]['max'] = high
        return self
374002
def plot_fixed_y(self, y_values, x_derivative=0, steps=1000, smooth=0, simple='auto', xmin="auto", xmax="auto", format=True, clear=1):
        
        if simple=='auto': simple=self.simple


        # get the min and max
        if xmin=="auto": xmin = self.xmin
        if xmax=="auto": xmax = self.xmax
        if clear: _pylab.gca().clear()

        if not type(y_values) in [type([]), type(_pylab.array([]))]: y_values = [y_values]

        for y in y_values:
            # define a new simple function to plot, then plot it
            def f(x): return self.evaluate(x, y, x_derivative, smooth, simple)
            _pylab_help.plot_function(f, xmin, xmax, steps, 0, True)

            # label it
            a = _pylab.gca()
            th = "th"
            if x_derivative == 1: th = "st"
            if x_derivative == 2: th = "nd"
            if x_derivative == 3: th = "rd"
            if x_derivative: a.set_ylabel(str(x_derivative)+th+" "+self.xlabel+" derivative of "+self.zlabel+" spline")
            else:            a.set_ylabel(self.zlabel)
            a.set_xlabel(self.xlabel)
            a.set_title(self._path+"\nSpline array plot at fixed y "+self.ylabel)
            a.get_lines()[-1].set_label("y ("+self.ylabel+") = "+str(y))
        if format: _s.format_figure()
        return a
490206
function(min, max) {
    return function limitY(params) {
      params.y = clamp(params.y, min, max);
      return params;
    };
  }
865251
def statistics(cls, function, group=None):
        
        benchmark = cls.results(function, group)
        results = {}
        for name, stat in {'avg': numpy.average, 'max': numpy.amax, 'med': numpy.median, 'min': numpy.amin, 'sum': numpy.sum}.items():
            results[name] = stat(benchmark, axis=0)
        return results
469759
def plot(self, file_type):
        

        samples = self.mod_data[file_type]
        plot_title = file_types[file_type]['title']
        plot_func = file_types[file_type]['plot_func']
        plot_params = file_types[file_type]['plot_params']
        return plot_func(samples,
                    file_type,
                    plot_title=plot_title,
                    plot_params=plot_params)
348209
function diff( x, y, scale ) {
	var f;
	var s;
	if ( x !== x || y !== y ) {
		return NaN;
	}
	if (
		x === PINF ||
		x === NINF ||
		y === PINF ||
		y === NINF
	) {
		if ( x === y ) {
			return NaN;
		}
		return PINF;
	}
	// If the absolute difference is `0`, then so is the relative difference:
	if ( x === y ) {
		return 0.0;
	}
	if ( isFunction( scale ) ) {
		f = scale;
	} else {
		if ( scale === void 0 ) {
			scale = 'max-abs';
		}
		f = SCALE[ scale ];
		if ( f === void 0 ) {
			throw new Error( 'invalid input argument. Unrecognized/unsupported scale function. Value: `' + scale + '`.' );
		}
	}
	s = f( x, y );
	if ( s === 0 ) {
		// Bail. No possible return value which works for all possible scale functions...
		return NaN;
	}
	return abs( (x - y) / s );
}
241520
function plot(options) {
  /* Required Options */
  if (!options.data || !options.filename) {
    throw("The options object must have 'data' and 'filename' properties!");
    return;
  }
  /* Translate data into an object if needs be */
  if (_.isArray(options.data)) {
    /* If it's a one-dimentional array */
    if (_.isEqual(_.flatten(options.data), options.data)) {
      options.data = { 'Series 1': options.data };
    }
  }

  /* Defaults */
  if (!options.style) {
    options.style = 'lines'; /* Default to lines */
  }

  /* Apply moving averages and maximums */
  if (options.moving_avg) {
    options.data = apply_moving_filter(options.data, moving_average, options.moving_avg);
  }
  if (options.moving_max) {
    options.data = apply_moving_filter(options.data, moving_maximum, options.moving_max);
  }

  /* Execute Gnuplot specifing a function to be called when it terminates */
  if (options.format === 'pdf') { /* Special setup for pdf */
    gnuplot = exec('gnuplot | ps2pdf - ' + options.filename,
		   (options.exec ? options.exec : {}),
		   options.finish || post_gnuplot_processing);

  } else { /* Default for everything else */
    gnuplot = exec('gnuplot > ' + options.filename,
		   (options.exec ? options.exec : {}),
		   options.finish || post_gnuplot_processing);
  }

  /* Sets up gnuplot based on the properties we've been given in the
   * options object */
  setup_gnuplot(gnuplot, options);

  /* Get an array containing all the series */
  var series = _.keys(options.data);
  /* Reject series that are functions or come from higher up the protoype chain */
  var i;
  for (i = 0; i < series.length; i += 1) {
    if (!options.data.hasOwnProperty(series[i]) ||
	typeof options.data[series[i]] === 'function') {
      delete series[i]; /* undefine this element */
    }
  }
  /* Filter out any undefined elements */
  series = _.filter(series, function() { return true; });

  /* Print the command to actually do the plot */
  gnuplot.stdin.write('plot');
  for (i = 1; i <= series.length; i += 1) { /* For each series */
    /* Instruct gnuplot to plot this series */
    gnuplot.stdin.write('\'-\' using 1:2 title\'' + series[i - 1] +
			'\' with ' + options.style + ' lt 1 lc ' + i);
    /* If another series is to follow, add a comma */
    if (i < series.length) { gnuplot.stdin.write(','); }
  }
  gnuplot.stdin.write('\n');

  /* Print out the data */
  for (i = 0; i < series.length; i += 1) { /* For each series */
    for (key in options.data[series[i]]) {
      gnuplot.stdin.write(key + ' ' + options.data[series[i]][key] + '\n');
    }
    /* Terminate the data */
    gnuplot.stdin.write('e\n');
  }

  gnuplot.stdin.end();
}
454306
function(min, max) {
    return function limitHfov(params) {
      var width = params.width;
      var height = params.height;
      if (width > 0 && height > 0) {
        var vmin = convertFov.htov(min, width, height);
        var vmax = convertFov.htov(max, width, height);
        params.fov = clamp(params.fov, vmin, vmax);
      }
      return params;
    };
  }
221071
def plot(x, y, rows=None, columns=None):
    
    if not rows or not columns:
        rows, columns = get_terminal_size()
    # offset for caption
    rows -= 4

    # Scale points such that they fit on canvas
    x_scaled = scale(x, columns)
    y_scaled = scale(y, rows)

    # Create empty canvas
    canvas = [[' ' for _ in range(columns)] for _ in range(rows)]

    # Add scaled points to canvas
    for ix, iy in zip(x_scaled, y_scaled):
        canvas[rows - iy - 1][ix] = '*'

    # Print rows of canvas
    for row in [''.join(row) for row in canvas]:
        print(row)

    # Print scale
    print(''.join([
        '\nMin x: ', str(min(x)),
        ' Max x: ',  str(max(x)),
        ' Min y: ',  str(min(y)),
        ' Max y: ',  str(max(y))
    ]))
83399
function genTicks(min, max, count) {
  var assign;

  if (max < min) {
    (assign = [max, min], min = assign[0], max = assign[1]);
  }

  var step = tickStep(min, max, count);
  var first = Math.floor(min / step) * step;
  var ticks$$1 = [first];
  var cur = first;

  while (cur < max) {
    cur += step;
    ticks$$1.push(cur);
  }

  if (Math.abs(min - ticks$$1[1]) < step) {
    ticks$$1.shift();
    ticks$$1[0] = min;
  }

  if (Math.abs(max - ticks$$1[ticks$$1.length - 2]) < step) {
    ticks$$1.pop();
    ticks$$1[ticks$$1.length - 1] = max;
  }

  return ticks$$1
}
1072609
def make_plot(self):
        
        args = self.args

        # constant input causes unhelpful (weird) error messages
        # translate them to English
        inmin = self.timeseries[0].min().value
        if inmin == self.timeseries[0].max().value:
            if not self.got_error:
                self.log(0, 'ERROR: Input has constant values [{:g}]. '
                            'Spectrogram-like products cannot process '
                            'them.'.format(inmin))
            self.got_error = True
        else:
            # create 'raw' spectrogram
            specgram = self.get_spectrogram()

            # there may be data that can't be processed
            if specgram is not None:  # <-DMM: why is this here?
                # apply normalisation
                if args.norm:
                    specgram = specgram.ratio(args.norm)

                self.result = specgram

                # -- update plot defaults

                if not args.ymin:
                    args.ymin = 1/args.secpfft if args.yscale == 'log' else 0

                norm = 'log' if args.color_scale == 'log' else None
                # vmin/vmax set in scale_axes_from_data()
                return specgram.plot(figsize=self.figsize, dpi=self.dpi,
                                     norm=norm, cmap=args.cmap)
207130
function minValue(bound, formatError) {
        'use strict';
        return function (value) {
            if (value || !isNaN(parseFloat(value))) {
                var intValue = Number(value);
                if (!isNaN(intValue) && intValue < bound) {
                    return formatError(intValue);
                }
            }
            return '';
        };
    }
1172661
def wrap_function(func):
    
    if is_text(func):
        return compile_expression(func)

    numarg = func.__code__.co_argcount
    if numarg == 0:

        def temp(row, rownum, rows):
            return func()

        return temp
    elif numarg == 1:

        def temp(row, rownum, rows):
            return func(row)

        return temp
    elif numarg == 2:

        def temp(row, rownum, rows):
            return func(row, rownum)

        return temp
    elif numarg == 3:
        return func