I have a matrix A with dimension of 288*15581 where 288 is the length of time. Hence, I have 15581 curves. when I plot them I have the picture attached.
The problem is I do not know how many point have been gathered at one specific location. Having A, how can I see the density of points? I think heat map can do it but I have no idea.

 採用された回答

jonas
jonas 2018 年 9 月 5 日

1 投票

5 件のコメント

Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018 年 9 月 5 日
The matrix A is data for 500 curves with length 288. The scatter plot is as follows:
Could you tell me how to use hist3 and and heat map?
jonas
jonas 2018 年 9 月 8 日
編集済み: jonas 2018 年 9 月 9 日
Here are some examples with different bin types. The first one shows the distribution of points over the area, the second one shows the same but with more bins and the third one shows the number of points in different intervals of y.
% Load data
data=load('A.mat');
y=data.A;
x=repmat(1:288,500,1)';
% Plot with standard settings
subplot(1,3,1)
hist3([x(:),y(:)],'CDataMode','auto')
axis tight
% n pts in intervals of y
subplot(1,3,2)
biny=75;
binx=75;
hist3([x(:),y(:)],[binx biny],'CDataMode','auto')
axis tight
% n pts in intervals of x
subplot(1,3,3)
biny=20;
binx=1;
hist3([x(:),y(:)],[binx biny],'CDataMode','auto')
axis tight
Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018 年 9 月 9 日
Could you tell me how to remove grid on the figure?
Also, I used colormap(gray) and the result is:
I want it in the reverse, I mean white background and black spots. Could you please help me?
jonas
jonas 2018 年 9 月 9 日
編集済み: jonas 2018 年 9 月 9 日
Im on phone so cannot try it out myself, but add
hist3(... 'edgecolor', 'none')
to your hist function. You can also try 'interp' instead of 'none'. Second question, try
colormap(flipud(gray))
You could also check out thus link for how to combine hist3 with pcolor
Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018 年 9 月 9 日
It worked. Thanks.

サインインしてコメントする。

その他の回答 (1 件)

KSSV
KSSV 2018 年 9 月 5 日

0 投票

Read about pcolor, surf.

3 件のコメント

Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018 年 9 月 5 日
That does not help.
KSSV
KSSV 2018 年 9 月 5 日
At a given time..you want to see how many points have certain y value?
Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018 年 9 月 5 日
Not exactly. I need to know how many points are in a certain small interval of y from zero to one. Then I will be able to count them and compare them with other y's in certain time. The more points, the more color in y-axis. I know how to think of it but I do not know how to implement it. Please do not refer me to a document. To help me, suppose you have a given matrix A including 50 sinusoidal with different frequency sampled at 200 points. How can you show more density of figures between -1 and 1?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by