Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
density plot?

Subject: density plot?

From: J G

Date: 3 Aug, 2011 23:19:29

Message: 1 of 5

Y = a vector (values >0 and <1) and I have shown the frequency at which they occur by hist(Y). However, I wondered if there was a way of showing this in some sort of density plot, showing which regions of the space between 0 and 1 more frequently occur in Y.
Thanks.

Subject: density plot?

From: Baalzamon

Date: 3 Aug, 2011 23:39:14

Message: 2 of 5

"J G" wrote in message <j1cl21$g2f$1@newscl01ah.mathworks.com>...
> Y = a vector (values >0 and <1) and I have shown the frequency at which they occur by hist(Y). However, I wondered if there was a way of showing this in some sort of density plot, showing which regions of the space between 0 and 1 more frequently occur in Y.
> Thanks.

In Doug's blog he covers a nice tutorial in which he turns a xy plot into 2dhisotgram
http://blogs.mathworks.com/videos/2010/01/22/advanced-making-a-2d-or-3d-histogram-to-visualize-data-density/

Subject: density plot?

From: TideMan

Date: 4 Aug, 2011 02:58:40

Message: 3 of 5

On 4/08/2011 11:19 a.m., J G wrote:
> Y = a vector (values >0 and <1) and I have shown the frequency at which
> they occur by hist(Y). However, I wondered if there was a way of showing
> this in some sort of density plot, showing which regions of the space
> between 0 and 1 more frequently occur in Y. Thanks.
But doesn't hist(y) give you just that?
The ordinate is the number of occurrences in the bins shown on the abscissa.

Subject: density plot?

From: J G

Date: 4 Aug, 2011 03:24:13

Message: 4 of 5

TideMan <nztideman@yahoo.co.nz> wrote in message <j1d1rv$q82$1@dont-email.me>...
> On 4/08/2011 11:19 a.m., J G wrote:
> > Y = a vector (values >0 and <1) and I have shown the frequency at which
> > they occur by hist(Y). However, I wondered if there was a way of showing
> > this in some sort of density plot, showing which regions of the space
> > between 0 and 1 more frequently occur in Y. Thanks.
> But doesn't hist(y) give you just that?
> The ordinate is the number of occurrences in the bins shown on the abscissa.

Yes it does - just wondered if there was something more like cloudPlot (http://www.mathworks.com/matlabcentral/fileexchange/23238-cloudplot) or similar but I guess not with only a vector...

Subject: density plot?

From: TideMan

Date: 4 Aug, 2011 05:12:09

Message: 5 of 5

On 4/08/2011 3:24 p.m., J G wrote:
> TideMan <nztideman@yahoo.co.nz> wrote in message
> <j1d1rv$q82$1@dont-email.me>...
>> On 4/08/2011 11:19 a.m., J G wrote:
>> > Y = a vector (values >0 and <1) and I have shown the frequency at which
>> > they occur by hist(Y). However, I wondered if there was a way of
>> showing
>> > this in some sort of density plot, showing which regions of the space
>> > between 0 and 1 more frequently occur in Y. Thanks.
>> But doesn't hist(y) give you just that?
>> The ordinate is the number of occurrences in the bins shown on the
>> abscissa.
>
> Yes it does - just wondered if there was something more like cloudPlot
> (http://www.mathworks.com/matlabcentral/fileexchange/23238-cloudplot) or
> similar but I guess not with only a vector...
But you've only got y, no x, so how would that work?
What the histogram gives you, if you divide n by the number of data, is
the empirical PDF (probability density function). You can integrate
this numerically to give the CDF (cumulative distribution function).

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us