Lines disappearing on plot
이전 댓글 표시
Hey there,
I am having a weird problem with a specific type of plot I like to make. There are three pictures attached. What I am doing is making a kind of heat map, then adding 4 black lines to denote the borders of something (top image in attachment). Then what I do is concatenate several of these heat maps side-by-side to represent my data changing in time in a subplot. I initially plot using:
h1 = subplot(3,1,i); imagesc(B); colormap(gray);
Where the variable 'B' is the heat map I am plotting (as in image #1 in attachment). When I do this, however, one of the black lines I original put on B is gone (image #2). Another one of the black lines disappears when I use 'axis image' and then make the plot prettier with the code below:
axis image;
x_lims = get(gca,'xlim');
x_lng = x_lims(2)-x_lims(1);
new_ticks = round(x_lng/numEpochs*(1:numEpochs-1));
set(gca,'xtick',new_ticks)
x_tic = get(gca,'XTick');
y_lims = get(gca,'YLim');
ylabel(tag2,'FontSize',13,'FontWeight','Bold')
set(gca, 'ytick', [], 'yticklabel', [], 'CLim', [0, 255]);
set(gca,'xticklabel',XTL+stimDur,'tickdir','out','FontWeight','Bold','FontSize',12)
set(gca,'ydir','reverse'); set(gca,'LineWidth',2);
set(gca,'xtick',x_tic)
The bottom image in the attachment shows what I end up with, which is my intended subplot, except that two sides of my rectangle are missing...
Does anyone see what I can do differently to prevent this from happening?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!