mvpa2.misc.plot.plot_err_line¶
-
mvpa2.misc.plot.
plot_err_line
(data, x=None, errtype='ste', curves=None, linestyle='--', fmt='o', perc_sigchg=False, baseline=None, **kwargs)¶ Make a line plot with errorbars on the data points.
Parameters: data : sequence of sequences
First axis separates samples and second axis will appear as x-axis in the plot.
x : sequence
Value to be used as ‘x-values’ corresponding to the elements of the 2nd axis id
data
. IfNone
, a sequence of ascending integers will be generated.errtype : ‘ste’ or ‘std’
Type of error value to be computed per datapoint: ‘ste’ – standard error of the mean, ‘std’ – standard deviation.
curves : None or list of tuple(x, y)
Each tuple represents an additional curve, with x and y coordinates of each point on the curve.
linestyle : str or None
matplotlib linestyle argument. Applied to either the additional curve or a the line connecting the datapoints. Set to ‘None’ to disable the line completely.
fmt : str
matplotlib plot style argument to be applied to the data points and errorbars.
perc_sigchg : bool
If
True
the plot will show percent signal changes relative to a baseline.baseline : float or None
**kwargs
Additional arguments are passed on to errorbar().
Returns: list
Of lines which were plotted.
Examples
Make a dataset with 20 samples from a full sinus wave period, computed 100 times with individual noise pattern.
>>> x = np.linspace(0, np.pi * 2, 20) >>> data = np.vstack([np.sin(x)] * 30) >>> data += np.random.normal(size=data.shape)
Now, plot mean data points with error bars, plus a high-res version of the original sinus wave.
>>> x_hd = np.linspace(0, np.pi * 2, 200) >>> elines = plot_err_line(data, x, curves=[(x_hd, np.sin(x_hd))]) >>> # pl.show()