Contour not working: The delineation erases (or minimizes) previous data from a plot
Show older comments
Contour function issue (I think)
Hi everyone, I am trying to get a delaniation (by using contour function) on a certain area in a figure.
Long story short I have the range on neural activity in the auditory cortex (several recordings and animals)
I am trying to find the areas with most change by using 90-95% percentile and making a X-score mask at p= 0.05.
When imaging the Range: It works flawlessly.
When imaging the Zscore: It works flawlessly.
When adding the contour of the zscore to the Range it does not work and the range seems to empty:

I get no warning and no error messages...
Here is the plotting code:
nRecs3 = numel(Recordings3);
figure;
sgtitle('Mouse 168: Range per condition','fontweight','bold','fontsize',16); %overall title
for iR3 = 1:nRecs3
sp = subplot(1, nRecs3, iR3);
im = imagesc(sp, squeeze(RANGE_3(:,:,iR3)'));
hold on; colorbar;
set(gca,'DataAspectRatio',[1,1,1]);
cont = contour(sp, ZMASK_3(:,:,iR2)', 1, 'r');
title(RecordingNames3{iR3})
xlabel('Anteroposterior (mm)'); %x axis label
ylabel('Mediolateral (mm)'); %y axis label
end
Does anyone know what the issue may be and how can I fix it?
As some extra info I do the same as previously (except looking at bottom percentile) mentioned with the RATIO and that seems to work just fine:

Accepted Answer
More Answers (0)
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!