Skip to main content

Questions tagged [histograms]

Tag for questions about building histograms in Mathematica. Apart from generating the graphics, and prettifying them, this also includes methods to extract their data.

Filter by
Sorted by
Tagged with
22 votes
7 answers
3k views

How do I plot a histogram with hatched shading?

I can plot an ordinary histogram with blue shading and black borders like this: T = RandomVariate[NormalDistribution[0, 1], 10000]; Histogram[T, 30] And I can ...
octopus's user avatar
  • 499
11 votes
4 answers
3k views

AxesLabel in Histogram3D unreadable

I'd like to modify this chart to relocate the z axis label so it's not over printing the values. ...
Cam's user avatar
  • 1,596
7 votes
2 answers
2k views

How to create a bar chart from a list of heights *and* bin delimiter positions?

Basically, I'm trying to produce the same output that Histogram[giganticList] would produce, but starting from the output of ...
kjo's user avatar
  • 11.7k
10 votes
1 answer
2k views

How can we create a histogram distribution from binning data?

HistogramDistribution takes a list of data points, creates a histogram from them, and returns this histogram in a form that can be used as a distribution. I ...
Szabolcs's user avatar
  • 236k
6 votes
2 answers
1k views

How can I have an axis label automatically positioned below the X-axis? [duplicate]

I'm attempting to generate some histograms, and I'd like to automatically label the X-axis. However, Histogram[. . ., AxesLabel -> {"X", "Y"}] places the "X" ...
Roger Harris's user avatar
  • 1,517
6 votes
3 answers
685 views

How to preserve clipping when exporting a framed histogram with font embedding?

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least ...
Pschoofs's user avatar
  • 429
17 votes
2 answers
3k views

ColorFunction in Histogram[]

Let's say I have a Histogram: Histogram[RandomVariate[NormalDistribution[10, 2], 500]] and I want the bars positioned to the ...
Ooku's user avatar
  • 891
12 votes
4 answers
1k views

How to rebuild original data from a histogram?

I have data in the following form. I have a list of values and a list of frequencies that indicate how often each value has occurred. Example list of values: ...
JohnnyM's user avatar
  • 489
4 votes
5 answers
16k views

How to create a histogram from a given frequency table

I wanted to draw a histogram as in the photo above, I typed the command: ...
Perw's user avatar
  • 41
4 votes
2 answers
385 views

Mysterious behaviour of ParallelTable

This question is related to Export bug in combination with ParallelTable?. The following code shows an even stranger bug than in the upper question. The y-axis should always be logarithmic, but in ...
mrz's user avatar
  • 11.7k
22 votes
3 answers
8k views

Circular Plot and Circular Histogram

The spherical or circular data arises when we measure data in degree e.g wind direction, clock and compass etc. Then representation of such data we need to plot circular plot, circular histogram and ...
SAAN's user avatar
  • 617
18 votes
7 answers
1k views

Elegantly pairing up mismatched lists

HistogramList returns a list of bin boundaries and a list of counts. There is one more boundary than counts, and I'd like to pair them up so I can feed it into <...
Brett Champion's user avatar
14 votes
3 answers
2k views

How can I tell mathematica to generate an histogram from nominal data?

If I write: Histogram[{1, 1, 1, 2, 2, 2}] I get a nice histogram chart but if I write ...
Luxspes's user avatar
  • 930
11 votes
1 answer
791 views

Representative Smooth Kernel Distribution from Truncated Distribution

I am trying to produce a better distribution from a dataset that is bounded to be greater than 0. Here is an example distribution from the documentation that mimics the behavior of the actual dataset: ...
Guillochon's user avatar
  • 6,137
8 votes
4 answers
3k views

Calculate mean of values in bins

Problem description: I have a list of $\{x,y\}$ pairs. I'd like to divide $x$ into equal[*] bins, say $bx_1, bx_2, \ldots$, calculate $\left<y\right>$ for every bin and then plot the bin values ...
stathisk's user avatar
  • 3,054
7 votes
4 answers
1k views

Smooth/histogram a 2D set

I have a 2D dataset like this one: {{x1,y1}, {x2,y2},...} I need to smooth/histogram the data in such a way that binning is over the x-coordinate, while counting/...
Petr's user avatar
  • 549
3 votes
1 answer
946 views

How to compute a discrete histogram of a list [duplicate]

I'm trying to compute the discrete histogram of a set of values. By histogram I mean the absolute frequency a value appears on the dataset, by discrete I mean the values are from a discrete set, e.g. ...
Jorge Leitao's user avatar
3 votes
1 answer
1k views

Combining Histogram and SmoothHistogram

How can we draw Histogram and SmoothHistogram together for two data sets?. I'd like to show the first data set using ...
SAAN's user avatar
  • 617
18 votes
6 answers
3k views

How to find major color in a picture?

I want to find the major color (the color which appears most often) in a picture and do some analysis later. For example, if I have this picture: What I want to do is find out that gray, red, black, ...
Po-Jen Lai's user avatar
14 votes
3 answers
652 views

Histogram3D with various colors and textures on cuboids' faces

I'm trying to produce an Histogram3D-like graph, but with a little more customization. In particular I want to manually specify the color of each cuboid and to print some information on the top faces....
glS's user avatar
  • 7,663
13 votes
3 answers
8k views

Histogram of a very large dataset?

I have a very large dataset stored in a file (over 2GB). The file contains a tab-separated table of floating-point numbers. I want to do an Histogram of all the numbers in the table. But if I try to ...
a06e's user avatar
  • 11.4k
12 votes
3 answers
1k views

Mathematica: Retrieving PlotRange from Histogram

Bug introduced in 10.0 or earlier and fixed in 12.0 I know that one can retrieve PlotRange of a plot by using ...
John's user avatar
  • 4,371
11 votes
1 answer
301 views

HistogramList for DateHistogram?

HistogramList and Histogram are closely related: ...
Kuba's user avatar
  • 137k
11 votes
3 answers
6k views

How to make a multi-peak histogram fitting

I got a multipeak histogram from my data and want to fit it using a Gaussian Distribution function. ...
Kai Tian's user avatar
  • 111
11 votes
2 answers
3k views

Histogram "PDF" vs "Probability"

I have a discrete random variable with values from $0$ to $100$. I have plotted its histogram with bars centered in $0, 5, 10,\dots,100$. First I made the histogram using the ...
user1993416's user avatar
9 votes
2 answers
4k views

How can I make a list plot with bars?

Can anyone help me please? I don't want a Histogram; I don't want a BarChart, not even a ListPlot with drop down lines. I want a list plot with drop down columns/bars: please see the link. It is ...
Uttam Pal's user avatar
  • 449
8 votes
2 answers
673 views

Bar chart scale in multi-chart visualisation

This is a rewording of a previous question which probably wasn't very well explained, and so didn't get any responses(!). I'm trying to create a chart which shows the smooth kernel distribution of ...
cwalker's user avatar
  • 161
6 votes
2 answers
876 views

Histogram3D using sums instead of counts

I'm trying to create a 3d histogram/ matrix plot pair. My data is in the form {{TTR1,TBF1},{TTR2,TBF2},....} What I would like is to modify the Histogram3D so ...
Cam's user avatar
  • 1,596
4 votes
2 answers
2k views

Multiple histograms grouped in a chart

I have this problem: I have three distributions and the relative histograms. But I would like to create an histogram in which the three columns of each single histogram for the same bin are put ...
Roryro87's user avatar
4 votes
1 answer
2k views

Histogram: Compare PDF to Data

Goal I would like to make a plot which satisfies the following: Formost it should contain the Histogram of the data, with an overlay of the PDF Two y-axes, the left being the count for the elements ...
SumNeuron's user avatar
  • 5,422
2 votes
1 answer
297 views

Histogram scale error when using DistributionChart

I'm a novice Mathematica user that is having some problems using the HistogramDensity function in a DistributionChart. My observations are heavily skewed to one category and the height of the other ...
user13947's user avatar
2 votes
2 answers
885 views

3D Histogram from discrete data

I have some (discrete) data of the type $\{x_i,y_i,z_i\}$ ...
ZeroTheHero's user avatar
1 vote
1 answer
1k views

Histogram For Non-Numerical Data

I have a non-numerical data, let say data = Table[RandomChoice[{0.2, 0.3, 0.25, 0.15, 0.1} -> {"A", "B", "C", "D", "E"}], {500}]; and i want to make a ...
Deco's user avatar
  • 857
1 vote
1 answer
523 views

How to fit a Weibull distribution function to histogram with unequal bins?

Whenever the function "FindDistributionParameter" is used in Wolfram Mathematica, it needs two inputs: raw data and distribution function. I have a problem where I have have data and I need to use ...
Cro Simpson2.0's user avatar
1 vote
1 answer
681 views

Exporting SmoothHistogram plot data

My program produces a large data set, which is distributed by some unknown function. I've used SmoothHistogram to visualise it crudely as a probability distribution ...
tlh's user avatar
  • 45
1 vote
2 answers
444 views

Histogram plot for fixed class interval

Age Size of Kidney 0-20 8.5 20-40 9.2 40-60 10.4 60-80 9.3 80-100 8.9 The above data gives the average size of the kidney for the people of age ...
Roshan Shrestha's user avatar
24 votes
3 answers
3k views

How can I make a heatmap of a days in year?

I know Mathematica has a ListPlot for time series but does it have a function for visualizing a list of dates as a heat map like this: This idea is from D3, check it out here.
M.R.'s user avatar
  • 31.6k
16 votes
1 answer
4k views

Make a density list plot/histogram from large, pre-binned data set?

I have a large data set consisting of $\mathcal{O}(10^9)$ two-dimensional points. In order to save memory and time I have pre-binned these into a uniform grid of $500 \times 500$ bins using Fortran. ...
cosmoguy's user avatar
  • 185
15 votes
5 answers
2k views

How to plot paired smooth histogram/distribution plots?

I've been trying to get paired distribution (aka "violin") plots like those shown below for a few hours, but all my attempts have failed. The key features here are paired smooth histograms/...
kjo's user avatar
  • 11.7k
13 votes
2 answers
1k views

Map of United States as a 3D histogram

By combining the state data from here and the extrusion code from here I have managed to make prisms of the various US states such as However, the extrusion method looses information about the ...
sonright's user avatar
  • 141
13 votes
1 answer
444 views

Constructing a ternary histogram

so this is currently what I'm building ...
MKF's user avatar
  • 613
6 votes
4 answers
2k views

Log-log scale smooth histogram

How can I create a smooth histogram with a log-log scale? I can use Histogram[data, "Log", "LogCount"] to get a log-log histogram, or I can use ...
Sean's user avatar
  • 535
6 votes
1 answer
771 views

How to evaluate differential entropy from raw data?

I want to evaluate the differential entropy according to here $$h(X) = - \int f(x) \log{f(x)} dx$$ where $f$ is the probability density function. Lets create some test data (normal distribution): <...
user29165's user avatar
  • 565
5 votes
2 answers
635 views

Fit function to histogram

I have a list: histx={-56.6335, -57.2327, -57.8607, -57.9682, -57.0061, -57.1872,-56.9209, -56.1284,...}; I managed to create the histogram that I wanted to: But ...
Paweł Chmolewski's user avatar
5 votes
3 answers
570 views

Histogram with the smaller bar in front

I am trying to visualise multiple data sets in one histogram. When using one or two datasets, the automatic transparency of the bars keeps everything relatively easy to see. When going to three or ...
Maarten's user avatar
  • 53
5 votes
1 answer
211 views

No values shown in histogram with "mouse-over"

Today I experienced a strange behavior in a histogram I made. Here a MWE: Given a set of points: pts = RandomReal[1, {1000, 2}]; and a helper function which ...
mgamer's user avatar
  • 5,603
5 votes
2 answers
2k views

How can I plot histogram with the same number of values in every bin?

For example I have 100 values sample. I'd like to build histogram in which every bin contains, for example, 10 values. How can i do that? Thanks.
instajke's user avatar
  • 351
4 votes
3 answers
972 views

How to relate a binned pdf to a pdf, taking into account how the data is binned?

I have a data set which I represent as a PDF histogram Histogram[Data,{"Raw", NumberOfBins},"PDF"]. I want to know the distribution parameters of my data. I've ...
user27119's user avatar
  • 2,520
4 votes
2 answers
2k views

Add two Histograms to calculate summed Mean and StandardDeviation

As a follow up to this question: Calculate mean and standard deviation from ImageHistogram I would like to add two histograms before calculating the mean and StDev. I would like to sum the numbers, ...
onemonkey's user avatar
4 votes
1 answer
176 views

Plotting evolution of probability with time

I have compiled data about the evolution of a function with time and the data looks something like this. I wanted to plot this data in the form of a density histogram such that every row represents ...
Manik Kapil's user avatar