MATLAB: Tight_subplot not showing tick marks

showing upsubplottickmarkstickmarks hiddentight subplottight_subploty x labelsy x tick marks

Hi,
I'm using tight_subplot from the file exchange to plot 4 similar graphs. I'm finding that, when I run my script, the x and y tick marks (i.e. 1,2,3…12) are disappearing for all 4 subplots. I'm not doing anything intentional to suppress them, but I am using a for loop to generate the four plots, which makes me wonder whether some information is being lost each time I end a loop.
Is there any sort of set command that I could use to bring these back up? Something like… set(ha(1:2),'XTickLabel','on')? (That doesn't work… ) I'd prefer not to have to actually assign the tick marks explicitly, but to get them from the metadata associated with the figures.
Thanks, Jonathan

Best Answer

  • If the plots are sufficiently close together, then the endpoints of the ticks might not be within the axes span: in such a case, MATLAB suppresses the line. This is the same case is if you have given specific axis limits and then you add a new line that starts or ends outside of the drawing area: the line will simply not be drawn. In order for MATLAB to draw a line, both endpoints must be within the clipping area.