Can you set the y-axis scale, but allow for a variable range?

14 views (last 30 days)
For instance, is it possible to restrict the y axis to a certain length, but allow that length to fall anywhere based on the given data?
I have several subplots that plot in different areas along the y-axis, but I need the plot scale to be maintained.

Answers (1)

jonas
jonas on 24 Aug 2018
Edited: jonas on 24 Aug 2018
Just use something like this
x=1:10;
y=rand(1,numel(x))+5
the_length=1; %length on x axis to view
plot(x,y)
set(gca, 'ylim', [min(y), min(y)+the_length])

Categories

Find more on Signal Processing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!