how can i solve the problem of these two images automatically (with a code adaptable to different data) without having to fix the axes range for each plot (i have millions of these plots)?
problem: axis range should be smaller
problem: axis range should be bigger
also, i need axis to be correctly labeled from the first value to last (see example in comment please)
any help is highly appreciated. thank you so so much.
In order to have a complete bounding box use
box on.In order to avoid large empty space around a plot (or no space at all) use
xlimandylim. Try the following:If you want to have a tick value appear at the start and the end of the axis, you could either force it by
set(gca,'Xtick',[values]), where values are those ticks you want to show; or byfloorandceilof the xlim and ylim min and max limits above.Hope this is what you need