MATLAB Answers

Hist3 issue , white lines appear in the plot

3 views (last 30 days)
Litalo
Litalo on 27 Nov 2020
Edited: Litalo on 1 Dec 2020
Hi all,
so im using hist3 to plot my data ,
i have two vectors, M and N, and edges for each of them;
edges_M=linspace(min(M), max(M),bins-1);
edges_N=linspace(min(N),max(N),bins-1);
edges={edges_M,edges_N};
[kxx, c]= hist3([M, N],'Edges',edges);
Normalization=kxx./max(kxx); (i do normalization per col, (per N vec))
pcolor(c{2},c{1},Normalization)
BUT
i get:
So what those lines? (white) Why does they appear in my plot? what they represent/ or not? how to deal with them?
I suspect it is a bug in hist3, but i really like matlab so better solve it and not run to other program XD,
Best,
Lital

  2 Comments

Rishik Ramena
Rishik Ramena on 1 Dec 2020
Can you share the entire code including the vectors and the edges?
Litalo
Litalo on 1 Dec 2020
hi actually my vectors are really long (24,950,000X1) so not sure how.
anyway i suspect more that it is a bug since in some runs it does not appear anywhere...(and in the last runs i did it work fine now :-) )
now im trying to do somthing else. which i would like help in,
so im using pcolor to plot my data as follow (i have vec_x, vec_y)
figure(3)
bins=50;
edges_x=linspace(min(vec_x), max(vec_x),bins-1);
edges_y=linspace(min(vec_y),max(vec_y),bins-1);
edges={edges_x,edges_y};
[kxx, c]= hist3([vec_x, vec_y],'Edges',edges);
Normalization=kxx./max(kxx);
pcolor(c{2},c{1},Normalization)
actually i want to change edges_y to be
edges_y=linspace(-0.6,0,bins-1);
but since my data in this vec is different range i get somthing like this:
how can i fix the figure such that where there is no data - it will be blue (which represent 0 prob)?
Best,
Lital

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by