Lines disappearing on plot

30 ビュー (過去 30 日間)
Pavlov
Pavlov 2014 年 11 月 1 日
コメント済み: Image Analyst 2014 年 11 月 2 日
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?

採用された回答

Image Analyst
Image Analyst 2014 年 11 月 1 日
Did you draw the line in the image itself? Or display it in the graphical overlay with the line() function? If it's in the image and only one pixel wide, then if the image gets shrunk down for display it's possible it won't appear due to which pixels get taken when it subsamples the image.
  2 件のコメント
Pavlov
Pavlov 2014 年 11 月 1 日
Ahh I see. I am introducing it into the image itself rather than using the line function after making each image, because it's easier. I suppose I can make each segment 2-3 pixels wide to avoid this.
Thanks!
Image Analyst
Image Analyst 2014 年 11 月 2 日
That would probably work - let us know if it doesn't. Thanks for accepting the answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by