clipping feature?

I set the axis bounds when I am plotting a number of lines

    > some of which have a larger domain. While interested in the
    > behaviour in the limited domain, I would like to retain the
    > information that some lines extend beyond. When I first
    > encountered this behaviour, I thought that I had mistakenly
    > truncated my input data - I think that the plot should show
    > as much of the data passed to it as possible.

    > Is there something I am missing - or is this a feature?

It's a feature!

matplotlib does two kinds of clipping: data clipping and viewport
clipping. Viewport clipping is the typical clipping where the lines
are clipped to the viewport. data clipping throws out all points not
in the viewport.

I work with very long data sets of which only a small portion is in
the viewport, and use the interactive navigation controls to scroll
trough it. I found it was much more efficient to first clip the data
with Numeric before plotting it. See examples/, of which
only a few days of 60 days of data are initially in the viewport.

You can control this in a couple of ways:

    from matplotlib.matlab import *
    ax = subplot(111)
    line1, line2 = plot([1,2,3,4],'bo', [1,2,3,4],'k')

Or edit the init function of lines.Line2D to turn data clipping off by

        self._useDataClipping = False

I've been meaning to make a matplotlibrc file to control things like
default line width, color, fontsize and name, antialiasing, data
clipping and so on.


I suggest to John a while back that for plotting it makes more sense for
data ranges to be inclusive

[] or min <= x <= max

rather than half-inclusive

[) or min <= x < max

as is the python default for functions like range().

Specifically, what about making the default behaviour to clip the data at
the first point which is equal or greater than the axis range? That should
maintain the efficiency gains of clipping, while still keeping the
scientific plotting behaviour that I think most users are accustomed to.