Hi,
I'm using hist3 to get bin centers and the elements in each bin. After this I use contourf to plot the data. Unfortunatelly the outputed contour figure has small vertical and horizointal black lines that don't seem to make sense. Please see lines inside red circles for examples:
My code is as follows:
edges = {0:0.2:13 0:0.2:13};
insetPos = [.52 .53 .35 .35];
[n,c] = hist3(X,'edges',edges);
figure
heatmap(n)
axes('Position',insetPos)
box on
contourf(c{1},c{2},n)
I belive the black lines are part of the contour lines, yet they appear where there are no boundries. If I remove the contour lines they also go away.
contourf(c{1},c{2},n,'LineColor','none')
Any tip on how I could keep the contour lines without drawing the "intruding" lines?
2 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/530058-contourf-is-plotting-weird-lines-how-to-remove-them#comment_856873
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/530058-contourf-is-plotting-weird-lines-how-to-remove-them#comment_856873
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/530058-contourf-is-plotting-weird-lines-how-to-remove-them#comment_857933
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/530058-contourf-is-plotting-weird-lines-how-to-remove-them#comment_857933
Sign in to comment.