Combine Histogram and Cumulative Distribution Matlab

Mary

How do I overlay the cumulative distribution of some data over a histogram of the same data? I have the following code:

DistributionData=Results(end,:);
figure(4)
clf
nbins = 100;
hist(DistributionData,nbins)
hold on
cdfplot(DistributionData)
hold off

But because the cdf is on a different scale I need to have that on a second y-axis. Ideally I want to plot the inverse cdf also.

Sam Roberts

Does this work for you?

a = randn(1000,1);
f = figure;
a1 = axes('Parent',f);
hist(a)
a2 = axes('Parent',f);
cdfplot(a)
grid off
set(a2,'Color','none')
set(a2,'YAxisLocation','right')

enter image description here

It's not perfect (for example, the tick marks on right and left axes are superimposed), and I haven't tidied up the title and axis labels, but perhaps that's a good start.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Plot a Cumulative Distribution Function in MATLAB

From Dev

Fitting the cumulative distribution function using MATLAB

From Dev

Distribution fitting and histogram overlay (scaling matter) - MATLAB

From Dev

Calculating cumulative hypergeometric distribution

From Dev

cumulative distribution in dictionary

From Dev

Cumulative distribution function (hypergeometric)

From Dev

Histogram in MatLab

From Dev

Fit a distribution to a histogram

From Dev

Histogram - Grade Distribution

From Dev

fitting a cumulative line to histogram with matplotlib

From Dev

Matlab Image Histogram Analysis: how do I test for an underlying bimodal distribution?

From Dev

CDF Cumulative Distribution Function Error

From Dev

Cumulative distribution in MongoDB using MapReduce

From Dev

Inverse of the cumulative gaussian distribution in R

From Dev

inverse cumulative distribution function in c?

From Dev

Cumulative Summation in intervals - MATLAB

From Dev

Compute Cumulative Returns in Matlab

From Dev

'Cumulative' bar chart in MATLAB

From Dev

Plot CDF + cumulative histogram using Seaborn Python

From Dev

Plotting cumulative histogram with negative and positive side in ggplot?

From Dev

numpy histogram cumulative density does not sum to 1

From Dev

Plot CDF + cumulative histogram using Seaborn Python

From Dev

multiple colours on matlab histogram

From Dev

Image histogram implementation with Matlab

From Dev

Estimating skewness of histogram in MATLAB

From Dev

stretching histogram of image in matlab

From Dev

a color histogram algorithm in matlab

From Dev

multiple colours on matlab histogram

From Dev

Normalizing a histogram in matlab

Related Related

HotTag

Archive