Package mvpa :: Package misc :: Package plot :: Module base
[hide private]
[frames] | no frames]

Module base

source code

Misc. plotting helpers.
Functions [hide private]
 
plotErrLine(data, x=None, errtype='ste', curves=None, linestyle='--', fmt='o', perc_sigchg=False, baseline=None)
Make a line plot with errorbars on the data points.
source code
 
plotFeatureHist(dataset, xlim=None, noticks=True, perchunk=False, **kwargs)
Plot histograms of feature values for each labels.
source code
 
plotSamplesDistance(dataset, sortbyattr=None)
Plot the euclidean distances between all samples of a dataset.
source code
 
plotBars(data, labels=None, title=None, ylim=None, ylabel=None, width=0.2, offset=0.2, color='0.6', distance=1.0, yerr='ste', **kwargs)
Make bar plots with automatically computed error bars.
source code
 
inverseCmap(cmap_name)
Create a new colormap from the named colormap, where it got reversed
source code
 
plotDatasetChunks(ds, clf_labels=None)
Quick plot to see chunk sctructure in dataset with 2 features
source code

Imports: P, N, NFoldSplitter, squared_euclidean_distance


Function Details [hide private]

plotErrLine(data, x=None, errtype='ste', curves=None, linestyle='--', fmt='o', perc_sigchg=False, baseline=None)

source code 
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. If None, a sequence of ascending integers will be generated.
  • errtype, 'ste', |, 'std' -
    Type of error value to be computed per datapoint.
    'ste': standard error of the mean 'std': standard deviation
  • curves, None, |, list, of, tuple(x, y) - Each tuple represents an additional curve, with x and y coordinates of each point on the curve.
  • linestyle, str - 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, |, None - Baseline used for converting values into percent signal changes. If None and perc_sigchg is True, the absolute of the mean of the first feature (i.e. [:,0]) will be used as a baseline.

plotFeatureHist(dataset, xlim=None, noticks=True, perchunk=False, **kwargs)

source code 
Plot histograms of feature values for each labels.

:Parameters:
  dataset: Dataset
  xlim: None | 2-tuple
    Common x-axis limits for all histograms.
  noticks: boolean
    If True, no axis ticks will be plotted. This is useful to save
    space in large plots.
  perchunk: boolean
    If True, one histogramm will be plotted per each label and each
    chunk, resulting is a histogram grid (labels x chunks).
  **kwargs:
    Any additional arguments are passed to matplotlib's hist().

plotSamplesDistance(dataset, sortbyattr=None)

source code 
Plot the euclidean distances between all samples of a dataset.
Parameters:
  • dataset, Dataset - Providing the samples.
  • sortbyattr, None, |, str - If None, the samples distances will be in the same order as their appearance in the dataset. Alternatively, the name of a samples attribute can be given, which wil then be used to sort/group the samples, e.g. to investigate the similarity samples by label or by chunks.

plotBars(data, labels=None, title=None, ylim=None, ylabel=None, width=0.2, offset=0.2, color='0.6', distance=1.0, yerr='ste', **kwargs)

source code 

Make bar plots with automatically computed error bars.

Candlestick plot (multiple interleaved barplots) can be done, by calling this function multiple time with appropriatly modified offset argument.

Parameters:

data: array (nbars x nobservations) | other sequence type
Source data for the barplot. Error measure is computed along the second axis.
labels: list | None
If not None, a label from this list is placed on each bar.
title: str
An optional title of the barplot.
ylim: 2-tuple
Y-axis range.
ylabel: str
An optional label for the y-axis.
width: float
Width of a bar. The value should be in a reasonable relation to distance.
offset: float
Constant offset of all bar along the x-axis. Can be used to create candlestick plots.
color: matplotlib color spec
Color of the bars.
distance: float
Distance of two adjacent bars.
yerr: 'ste' | 'std' | None
Type of error for the errorbars. If None no errorbars are plotted.
**kwargs:
Any additional arguments are passed to matplotlib's bar() function.

plotDatasetChunks(ds, clf_labels=None)

source code 

Quick plot to see chunk sctructure in dataset with 2 features

if clf_labels is provided for the predicted labels, then incorrectly labeled samples will have 'x' in them