Problem 1: the black lines
Those black lines are merely 100s of tick labels (or, the equivalent of axis ticks in Heatmap) . Your data seems to be a matrix with size [750, 600] which means there are a few hundred ticks on each axis, all squished together. Notice the layers of ticks become thicker as ticks move from 1s to 10s to 100s. The problem can be recreated with this line of code:
To remove the axis ticks,
h = heatmap(rand(600,750));
hs.XAxis.TickValues = [];
hs.YAxis.TickValues = [];
Alternatively, (better than the version above; added Dec 29, 2020)
h = heatmap(rand(600,750));
Or to show every 50 ticks (added Dec 29, 2020)
h = heatmap(rand(600,750));
h.YDisplayData = h.YDisplayData([1,50:50:end]);
h.YDisplayData = h.YDisplayData([1,50:50:end]);
However, I don't recommend using heatmap. Instead, I think imagesc() would be the better choice.
Problem 2: All plots look the same
It's tough to troubleshoot that one without seeing the data, your plots, or stepping through your code. If I were you, I'd follow these steps:
- Run the code to produce 1 figure
- Look into the data and find position within the matix where the values should indicate white areas of the plot. The function find() will come in handy.
- Then find those location on the plot to confirm that they aren't white. If you use imagesc() note that the y-axis is reversed by default (as it is in Heatmap). If you'd like to flip it to normal: set(gca, 'YDir', 'Normal')
- Then repeat the process for the 2nd plot and so on. If you find values that represent white, those areas should be white on your plot.
Best Answer