1

I'm using the heatmap function in Matlab to plot some maps, the maps themselves are fine but the program seems to be adding extra borders and axes onto the figures, no idea why this is happening!

My code is:

  figure(1)
hFig = figure(1);
set(gcf,'PaperPositionMode','auto')
set(hFig,'Position',[1000 1000 900 800])
colormap('hot');
imagesc(data)
xlabel('X({\mu}m)')
ylabel('Y({\mu}m)')

Here is an image of what I mean by extra axes:

enter image description here

Thanks!

Edit1: Here is the image after the first proposed fix:

enter image description here

KRS-fun
  • 696
  • 3
  • 9
  • 20

1 Answers1

0

Remove the xlabel and ylabel from the last lines of your code. Since you have already used the set function you can integrate them directly by doing

    imagesc(data);
    colomap('hot');
    set(gca,'Xtick',[0:5:50],'XtickLabel',[0:5:50]);
    set(gca,'Ytick',[0:5:50],'YtickLabel',[0:5:50]);
    colorbar('YtickLabel',{'1000','900','800'});
Kashif Nawaz
  • 95
  • 1
  • 1
  • 13
  • Hi, thanks for your comment. Your solution does get rid of the axes, but it seems to leave some 'squiggles' on my figures, I've posted the edit on my post! – KRS-fun May 27 '14 at 16:10
  • By squiggles u mean in the figure or those lines surrounding the box? also, i think you could add the 'auto' parameter which you were using; just see the matlab syntax for set(gca,...,parameters). Also, you could put the imagesc(data) at the last line and re-check. – Kashif Nawaz May 27 '14 at 17:20