histogram

OpenCV C++ calcHist to Java

最后都变了- 提交于 2019-12-23 02:42:05
问题 I'm trying to get some c++ code to run on my Android device; however, I'm running into a small little problem with the type of Mat I'm using. The code I'm trying to convert is as follow (the second function calls the first): static Mat histc_(const Mat& src, int minVal=0, int maxVal=255, bool normed=false) { Mat result; // Establish the number of bins. int histSize = maxVal-minVal+1; // Set the ranges. float range[] = { static_cast<float>(minVal), static_cast<float>(maxVal+1) }; const float*

how to plot a histogram in c

心已入冬 提交于 2019-12-23 02:19:05
问题 how do I plot a histogram in c from 2 arrays? 回答1: For a histogram layed out on its side... I suggest using printf("*") for each increment, and printf("\n") to start outputting a new row. (Changing the orientation is an excercise to the reader). 回答2: Thinking about the problem a bit I'm not convinced that the "duplicate" I identified in the comments is really responsive. So I'll say a few words. If you've settled on a ASCII art approach, then you have only one more decision to make: vertical

D3 Histogram with negative values

主宰稳场 提交于 2019-12-22 18:18:29
问题 I've been following this tutorial: http://www.youtube.com/watch?v=cu-I2um024k and I'm trying to create a histogram using an array of data points. My code works fine when the data points are all positive values: http://jsfiddle.net/sbeleidy/yDBQU/ var data = [1,2,3,4,5,6,9,12,23,5,4,1,2,30,24,21,18,19,41,43,36,38,5,52,1,23,1,2,5,3,1,2,4,4,21,2,3,4,1,2,5,7,8,5,3,1,10,12,24,4,21,34,35,35,35,35,36,37,32,1,31,32,32,23,23,24,25,27,45,46,47,0]; var width = 500, height = 500, padding = 50; var

Exporting Histogram from R to Excel

人走茶凉 提交于 2019-12-22 18:00:58
问题 I have some data in R that I would like to represent as a histogram (actually, I'll have 6 histograms) and then export those graphs into an excel file. I have just been using the hist() function, but I'm also experimenting with ggplot2 functions. Every histogram has 10,000 pieces of data, so I can't just export the raw data and create the histograms in excel (I'm assuming that this would lead to a ridiculously sized excel file, which I don't want). Is there any way I can export my graphs? 回答1

cumulative traffic by time of day with elasticsearch

耗尽温柔 提交于 2019-12-22 17:48:31
问题 i'm receiving requests/events from a large number of client applications. i'd like to use elasticsearch to find out when my highest traffic point is. one thing i've tried is a filter aggregation with a nested histogram and then a nested "terms" aggregation that gets the distinct hour of the day via a script field. the following is my attempt, and it performs terribly (as I'd expect since I'm executing a script per document). { "aggs": { "sites_within_range": { "filter" : { "range" : {

how to use a log scale for y-axis of histogram in R?

痞子三分冷 提交于 2019-12-22 17:07:18
问题 I have a large dataset with the lifespan of threads on an discussion board. I want a histogram that shows the distribution of lifespan, so I did this: dall <- read.csv("lifespan.csv") colnames(dall) <- c("thread.id", "seconds.alive", "start.time") hist(dall$seconds.alive) which generated this hard to read image: My questions are a) is changing y-axis to a log-scale a good way to make it more readable? Apparently some people think is a bad idea to change y-axis to log. b) how do I do that? 回答1

R - faster alternative to hist(XX, plot=FALSE)$count

我怕爱的太早我们不能终老 提交于 2019-12-22 11:10:14
问题 I am on the lookout for a faster alternative to R's hist(x, breaks=XXX, plot=FALSE)$count function as I don't need any of the other output that is produced (as I want to use it in an sapply call, requiring 1 million iterations in which this function would be called), e.g. x = runif(100000000, 2.5, 2.6) bincounts = hist(x, breaks=seq(0,3,length.out=100), plot=FALSE)$count Any thoughts? 回答1: A first attempt using table and cut : table(cut(x, breaks=seq(0,3,length.out=100))) It avoids the extra

Histogram using gnuplot with multiple y-axes

时光总嘲笑我的痴心妄想 提交于 2019-12-22 11:08:22
问题 I could not find a solution to the following issue I am facing. All SO questions on multi-axis talk about line plots, but I am looking for histograms. The y-range for the bars are different, so one set of bars are not really seen because of the scale. Here is the data: Metric A B M1 0.613416301 0.543734744 M2 0.000195961 0.000100190 Here is the MWE: reset set term postscript eps size 5.5,4.5 enhanced color font 'Arial-Bold' 25 set out 'histplot.eps' set key right set style histogram cluster

Plot histogram and density function curve on one chart

有些话、适合烂在心里 提交于 2019-12-22 10:34:04
问题 I have a density function f, and I do MCMC sampling for it. To evaluate the goodness of the sampling, I need to plot the hist and curve within the same chart. The problem of hist(samples); curve(dfun,add=TRUE); is that they are on the different scale: the frequency of a certain bin is usually hundreds, while the maximum of a density function is about 1 or so. What I want to do is to configure two plots at the same height, with one y-axis on the left and the other on the right. Can anyone help

2D histogram with Python

烂漫一生 提交于 2019-12-22 10:16:52
问题 I'm trying to plot a 2D histogram in Python using these code from math import * import pylab as p import matplotlib.pyplot as plt import numpy as np x=part.points[:,0] y=part.points[:,1] z=part.points[:,2] H, xedges, yedges = np.histogram2d(x, y, bins=(128,128)) H.shape, xedges.shape, yedges.shape extent = [yedges[0], yedges[-1], xedges[-1], xedges[0]] plt.imshow(H, extent=extent, interpolation='nearest') plt.colorbar() plt.xlabel("x") plt.ylabel("y") plt.show() Every thing works fine: I have