Questions tagged [histogram]

In statistics, a histogram is a graphical representation, showing a visual impression of the distribution of data.

In statistics, a histogram is a graphical representation, showing a visual impression of the distribution of data. It is an estimate of the probability distribution of a continuous variable and was first introduced by Karl Pearson. A histogram consists of tabular frequencies, shown as adjacent rectangles, erected over discrete intervals (bins), with an area equal to the of the observations in the interval. The height of a rectangle is also equal to the frequency density of the interval, i.e., the frequency divided by the width of the interval. The total area of the histogram is equal to the number of data. A histogram may also be normalized displaying relative frequencies. It then shows the proportion of cases that fall into each of several categories, with the total area equaling 1. The categories are usually specified as consecutive, non-overlapping intervals of a variable. The categories (intervals) must be adjacent, and often are chosen to be of the same size.

Histograms are used to plot density of data, and often for density estimation: estimating the probability density function of the underlying variable. The total area of a histogram used for probability density is always normalized to 1. If the length of the intervals on the x-axis are all 1, then a histogram is identical to a relative frequency plot.

In scientific software for statistical computing and graphics, The function hist generates a histogram. It can also optionally scale it so that its total area is 1. This puts it in the right scale if one want to overlay a probability density curve.

More about it here : histogram wiki

6663 questions
9
votes
2 answers

side by side multiply histogram in matlab

I would like to produce a plot like the following in matlab. Or may be something like this
Areza
  • 5,623
  • 7
  • 48
  • 79
9
votes
2 answers

Make a histogram of a pandas series

I want to make a histogram of a pandas series (prior_fails) but I keep getting the following ValueError: ValueError: view limit minimum -36814.8560105 is less than 1 and is an invalid Matplotlib date value. This often happens if you pass a…
Emma
  • 443
  • 2
  • 5
  • 13
9
votes
1 answer

Draw Histogram of a colored Image with Opencv

Can anyone give an example of code in C / C + + that creates histograms for a colored image (RGB) and displays them?
BlackShadow
  • 1,005
  • 6
  • 19
  • 25
9
votes
4 answers

Automatically find optimal image threshold value from density of histogram plot

I'm looking to perform optical character recognition (OCR) on a display, and want the program to work under different light conditions. To do this, I need to process and threshold the image such that there is no noise surrounding each digit,…
bhenders
  • 123
  • 2
  • 6
9
votes
1 answer

Grafana histogram displays wrong values (Datasource: Prometheus)

I'm using Grafana 4.3.2 with Prometheus 2.0 as the datasource. I'm trying to display a Prometheus histogram on Grafana. The values I retrieve from Prometheus is like the following: http_request_duration_seconds_bucket{, le="+Inf"} …
user2604150
  • 379
  • 5
  • 18
9
votes
2 answers

3D view of 2D histogram (heat map) in gnuplot

How can I (or can I) present this gnuplot histogram: in this style of 3D histogram view - in gnuplot?: Using the same data and data format as in the gnuplot example in answer would be best.
spinkus
  • 7,694
  • 4
  • 38
  • 62
9
votes
4 answers

Contrast stretching in Python/ OpenCV

Searching Google for Histogram Equalization Python or Contrast Stretching Python I am directed to the same links from python documentation in OpenCv which are actually both related to equalization and not stretching…
RMS
  • 1,350
  • 5
  • 18
  • 35
9
votes
2 answers

Python Jupyter Notebook: Put two histogram subplots side by side in one figure

I am using Python (3.4) Jupyter Notebook. I have the following two histograms in two separated cells, each has their own figure: bins = np.linspace(0, 1, 40) plt.hist(list1, bins, alpha = 0.5, color = 'r') and bins = np.linspace(0, 1,…
Edamame
  • 23,718
  • 73
  • 186
  • 320
9
votes
1 answer

R histogram range error: some 'x' not counted; maybe 'breaks' do not span range of 'x

I have a dataset that I'd like to plot with hist in R. There are a number of rows in the dataset whose values are beyond a value that I care about. Specifically, my R script is: library(ggplot2) data = read.table("input.txt", sep=" ",…
Rob Stewart
  • 1,812
  • 1
  • 12
  • 25
9
votes
5 answers

Creating a matplotlib or seaborn histogram which uses percent rather than count?

Specifically I'm dealing with the Kaggle Titanic dataset. I've plotted a stacked histogram which shows ages that survived and died upon the titanic. Code below. figure = plt.figure(figsize=(15,8)) plt.hist([data[data['Survived']==1]['Age'],…
WillacyMe
  • 562
  • 1
  • 6
  • 25
9
votes
5 answers

Printing class histogram programmatically

is there any way to print top used N classes on the current java application programmatically? sample output: N=10 num #instances #bytes class name -------------------------------------- 1: 23 4723136 [I 2: 19 …
Trustin
  • 151
  • 1
  • 4
9
votes
1 answer

Scaled logarithmic binning in python

I'm interested in plotting the probability distribution of a set of points which are distributed as a power law. Further, I would like to use logarithmic binning to be able to smooth out the large fluctuations in the tail. If I just use logarithmic…
SarthakC
  • 193
  • 1
  • 1
  • 6
9
votes
2 answers

Matplotlib bar plot remove internal lines

I have a bar plot with high resolution. Is it possible to have only the border/frame/top line of the plot like in the following ROOT plot without, i.e. without internal lines? If I plot with facecolor='none' or 'white', the plot is slashed by both…
sagitta
  • 321
  • 2
  • 7
9
votes
1 answer

OpenCV Histogram Comparison Methods

Looking at the Histogram Documentation, there are 4(5) different comparison methods: CV_COMP_CORREL Correlation CV_COMP_CHISQR Chi-Square CV_COMP_INTERSECT Intersection CV_COMP_BHATTACHARYYA Bhattacharyya distance CV_COMP_HELLINGER Synonym for…
MLMLTL
  • 1,519
  • 5
  • 21
  • 35
9
votes
1 answer

python matplotlib save graph without showing

I would like to create a histogram and save it to a file without showing it on the screen. The piece of code I have now is showing the figure by default and I cannot find any way to suppress showing the figure. I have tried pyplot.hist(nrs) as…