[Tutor] Plotting subsets of data

Danny Yoo dyoo at hashcollision.org
Mon Dec 8 20:49:16 CET 2014

On Mon, Dec 8, 2014 at 7:48 AM, Colin Ross <colin.ross.dal at gmail.com> wrote:
> Good afternoon,
> I am using the following to code to plot the output from an optical encoder:

Hi Colin,

Matplotlib is a third-party library, so you may also consider asking
the matplotlib folks.

>From a brief look at:


it appears that you can override the default axis, and specify xmin,
ymin, xmax, and ymax values.


For your particular case, you may want to just limit your x axis, in
which case xlim() might be appropriate.


If all else fails, just filter your data before submitting it to the
grapher.  The program loads data here, using loadtxt

    data = np.loadtxt('2014_12_04-16_30_03.txt',skiprows = 0 ,usecols = (0,1))

and it's just a numpy array: you can manipulate numpy arrays.   See:


as an example of an approach.

More information about the Tutor mailing list