I'm trying to scale axes in Matlab to a certain size without having to manually change the axes every time I run my simulation. I would like to set the x axes only and leave the y axes as default.
I am using -inf and inf for the yaxis limits because I would like those to stay at default values. However, it changes the y axis limits to the maximum and minimum value of the waveform instead of leaving a little bit of space at the top and bottom when I don't set limits.
Here is a picture that explains what I want a little better:
(the first image shows simulation with no axis settings--but I had to manually change x axis because it keeps showing time longer than my simulation--, the second shows the simulation with axis settings)
I am using this code:
axis([0 1.2 -inf inf])
Oh yeah, I can't just replace -inf with 0 because I am going to be plotting sinusoidal waveforms too.
I am using -inf and inf for the yaxis limits because I would like those to stay at default values. However, it changes the y axis limits to the maximum and minimum value of the waveform instead of leaving a little bit of space at the top and bottom when I don't set limits.
Here is a picture that explains what I want a little better:
(the first image shows simulation with no axis settings--but I had to manually change x axis because it keeps showing time longer than my simulation--, the second shows the simulation with axis settings)

I am using this code:
axis([0 1.2 -inf inf])
Oh yeah, I can't just replace -inf with 0 because I am going to be plotting sinusoidal waveforms too.