Fill this histogram from a view of another histogram
498391
def fill_view(self, view):
        
        other = view.hist
        _other_x_center = other.axis(0).GetBinCenter
        _other_y_center = other.axis(1).GetBinCenter
        _other_z_center = other.axis(2).GetBinCenter
        _other_get = other.GetBinContent
        _other_get_bin = super(_HistBase, other).GetBin
        other_sum_w2 = other.GetSumw2()
        _other_sum_w2_at = other_sum_w2.At

        _find = self.FindBin
        sum_w2 = self.GetSumw2()
        _sum_w2_at = sum_w2.At
        _sum_w2_setat = sum_w2.SetAt
        _set = self.SetBinContent
        _get = self.GetBinContent

        for x, y, z in view.points:
            idx = _find(
                _other_x_center(x),
                _other_y_center(y),
                _other_z_center(z))
            other_idx = _other_get_bin(x, y, z)
            _set(idx, _get(idx) + _other_get(other_idx))
            _sum_w2_setat(
                _sum_w2_at(idx) + _other_sum_w2_at(other_idx),
                idx)
1232452
def fill_rect(framebuf, x, y, width, height, color):
        """"""
        # pylint: disable=too-many-arguments
        while height > 0:
            index = (y >> 3) * framebuf.stride + x
            offset = y & 0x07
            for w_w in range(width):
                framebuf.buf[index + w_w] = (framebuf.buf[index + w_w] & ~(0x01 << offset)) |\
                                           ((color != 0) << offset)
            y += 1
            height -= 1
480595
public void setColorRange(int firstIndex, int lastIndex, int color1, int color2) {
		for (int i = firstIndex; i <= lastIndex; i++)
			map[i] = ImageMath.mixColors((float)(i-firstIndex)/(lastIndex-firstIndex), color1, color2);
	}
1088382
function extractHOGFromHistograms(histograms, options) {
  var blockSize = options.blockSize || 2;
  var blockStride = options.blockStride || (blockSize / 2);
  var normalize = norms[options.norm || "L2"];

  var blocks = [];
  var blocksHigh = histograms.length - blockSize + 1;
  var blocksWide = histograms[0].length - blockSize + 1;

  for (var y = 0; y < blocksHigh; y += blockStride) {
    for (var x = 0; x < blocksWide; x += blockStride) {
      var block = getBlock(histograms, x, y, blockSize);
      normalize(block);
      blocks.push(block);
    }
  }
  return Array.prototype.concat.apply([], blocks);
}
614103
def projection(self, axis):
        """"""
        axis = self.get_axis_number(axis)
        projected_hist = np.sum(self.histogram, axis=self.other_axes(axis))
        return Hist1d.from_histogram(projected_hist, bin_edges=self.bin_edges[axis])
1308367
def Draw(self, *args, **kwargs):
        
        self.reset()
        output = None
        while self._rollover():
            if output is None:
                # Make our own copy of the drawn histogram
                output = self._tree.Draw(*args, **kwargs)
                if output is not None:
                    output = output.Clone()
                    # Make it memory resident (histograms)
                    if hasattr(output, 'SetDirectory'):
                        output.SetDirectory(0)
            else:
                newoutput = self._tree.Draw(*args, **kwargs)
                if newoutput is not None:
                    if isinstance(output, _GraphBase):
                        output.Append(newoutput)
                    else:  # histogram
                        output += newoutput
        return output
921861
def from_histogram(cls, histogram, bin_edges, axis_names=None):
        
        bin_edges = np.array(bin_edges)
        self = cls(bins=bin_edges, axis_names=axis_names)
        self.histogram = histogram
        return self
288961
def merge_from(self, other):
        """"""
        if other.national_number_pattern is not None:
            self.national_number_pattern = other.national_number_pattern
        if other.example_number is not None:
            self.example_number = other.example_number
582868
def new_histogram_with_implicit_reservoir(name, reservoir_type='uniform', *reservoir_args, **reservoir_kwargs):
    

    reservoir = new_reservoir(reservoir_type, *reservoir_args, **reservoir_kwargs)
    return new_histogram(name, reservoir)
106963
function(a,b) {
			if( hasXY( a ) && hasXY( b ) ){
				this.x = mathUtils.clip(this.x, a.x, b.x);
				this.y = mathUtils.clip(this.y, a.y, b.y);
			} else if( isRect( a ) ){
				this.x = mathUtils.clip(this.x, a.x, a.x + a.width);
				this.y = mathUtils.clip(this.y, a.y, a.y + a.height);
			}
			return this;
		}
430750
def hidden_from(self, a, b):
        """"""
        return a in self.hidden_indices and not self.in_same_box(a, b)
1252478
protected void sortPixels(GrayU8 input) {
		// initialize histogram
		for( int i = 0; i < histogram.length; i++ ) {
			histogram[i].reset();
		}
		// sort by creating a histogram
		for( int y = 0; y < input.height; y++ ) {
			int index = input.startIndex + y*input.stride;
			int indexOut = (y+1)*output.stride + 1;
			for (int x = 0; x < input.width; x++ , index++ , indexOut++) {
				int value = input.data[index] & 0xFF;
				histogram[value].add(indexOut);
			}
		}
	}
1060229
def sample_histograms(fig, input_sample, problem, param_dict):
    '''

    '''
    num_vars = problem['num_vars']
    names = problem['names']

    framing = 101 + (num_vars * 10)

    # Find number of levels
    num_levels = len(set(input_sample[:, 1]))

    out = []

    for variable in range(num_vars):
        ax = fig.add_subplot(framing + variable)
        out.append(ax.hist(input_sample[:, variable],
                           bins=num_levels,
                           normed=False,
                           label=None,
                           **param_dict))

        ax.set_title('%s' % (names[variable]))
        ax.tick_params(axis='x',  # changes apply to the x-axis
                       which='both',  # both major and minor ticks are affected
                       bottom='off',  # ticks along the bottom edge are off
                       top='off',  # ticks along the top edge are off
                       labelbottom='off')  # labels along the bottom edge off)
        if variable > 0:
            ax.tick_params(axis='y',  # changes apply to the y-axis
                           which='both',  # both major and minor ticks affected
                           labelleft='off')  # labels along the left edge off)

    return out
616065
def histogram(module, name, value):
    
    histogram = get_metric('histograms', module, name, Histogram())
    histogram.update(value)
1014533
def hist2d(x, y, label=None, opacity=None):
    
    x = np.atleast_1d(x)
    y = np.atleast_1d(y)
    data = [go.Histogram2d(x=x, y=y, opacity=opacity, name=label)]
    return Chart(data=data)
133694
def fill_rect(self, rect):
        
        check_int_err(lib.SDL_RenderFillRect(self._ptr, rect._ptr))
487892
private void combineHistogramSameBuckets(FixedBucketsHistogram otherHistogram)
  {
    long[] otherHistogramArray = otherHistogram.getHistogram();
    for (int i = 0; i < numBuckets; i++) {
      histogram[i] += otherHistogramArray[i];
    }

    count += otherHistogram.getCount();
    max = Math.max(max, otherHistogram.getMax());
    min = Math.min(min, otherHistogram.getMin());

    outlierHandler.handleOutliersForCombineSameBuckets(otherHistogram);
  }