healpy.projaxes.CartesianAxes.acorr

CartesianAxes.acorr(x, **kwargs)

Plot the autocorrelation of x.

Call signature:

acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True,
      maxlags=10, **kwargs)

If normed = True, normalize the data by the autocorrelation at 0-th lag. x is detrended by the detrend callable (default no normalization).

Data are plotted as plot(lags, c, **kwargs)

Return value is a tuple (lags, c, line) where:

  • lags are a length 2*maxlags+1 lag vector
  • c is the 2*maxlags+1 auto correlation vector
  • line is a Line2D instance returned by plot()

The default linestyle is None and the default marker is 'o', though these can be overridden with keyword args. The cross correlation is performed with numpy.correlate() with mode = 2.

If usevlines is True, vlines() rather than plot() is used to draw vertical lines from the origin to the acorr. Otherwise, the plot style is determined by the kwargs, which are Line2D properties.

maxlags is a positive integer detailing the number of lags to show. The default value of None will return all (2*len(x)-1) lags.

The return value is a tuple (lags, c, linecol, b) where

  • linecol is the LineCollection
  • b is the x-axis.

See also

plot() or vlines() For documentation on valid kwargs.

Example:

xcorr() is top graph, and acorr() is bottom graph.