help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scoping x and y limits simultaneously


From: Kire Pudsje
Subject: Re: Scoping x and y limits simultaneously
Date: Fri, 9 Jun 2017 20:13:23 +0200



On Fri, Jun 9, 2017 at 7:07 PM, Fritz Sonnichsen <address@hidden> wrote:
I am processing a rather large dataset and want to create and zoom various plots. I am easily able to zoom the x axis using the axis([x1 x2]) type command. However when I do this I need to re-normalize the y limits to fill the plot.
      At present I have a rather lengthy script that finds the min and max y values within the new range , retrieve their indices,  and then divides all the y values.

However I was thinking there is a better way to do this as such:

data="">s\gases\spectra\testdata.csv');
plot(data(:,1),data(:,2));
axis([20 30]);
ylim auto

This does not work. The "auto" mandate scopes the y across the complete range, not just the scoped down range.

Is there a way to do this without my scripts?

I think it would be hard to implement in a generic way, since although most plots use a monotonic increasing x-axis, this does not have to be the case. Also if the limits of x and y are not aligned with the data, the intersection of all segments that cross the limits should be interpolated.

Why not just create plots with a subset of the data?
ss=(20 <= data(:,1)) & (data(:,1) <= 30);
plot(data(ss,1), data(ss,2));


reply via email to

[Prev in Thread] Current Thread [Next in Thread]