ca.nengo.plot
Class Plotter

java.lang.Object
  extended by ca.nengo.plot.Plotter
Direct Known Subclasses:
DefaultPlotter

public abstract class Plotter
extends java.lang.Object

Factory for frequently-used plots.

Author:
Bryan Tripp

Constructor Summary
Plotter()
           
 
Method Summary
static void closeAll()
          Close all open plots
 javax.swing.JFrame createFrame()
           
abstract  void doPlot(float[] domain, float[] vector, java.lang.String title)
           
abstract  void doPlot(float[] vector, java.lang.String title)
           
abstract  void doPlot(Function function, float start, float increment, float end, java.lang.String title)
           
abstract  void doPlot(java.util.List<TimeSeries> series, java.util.List<SpikePattern> patterns, java.lang.String title)
           
abstract  void doPlot(NEFEnsemble ensemble)
           
abstract  void doPlot(NEFEnsemble ensemble, java.lang.String origin)
           
abstract  void doPlot(SpikePattern pattern)
           
abstract  void doPlot(TimeSeries series, java.lang.String title)
           
abstract  void doPlot(TimeSeries ideal, TimeSeries actual, java.lang.String title)
           
static TimeSeries filter(TimeSeries series, float tauFilter)
           
static void plot(float[] domain, float[] vector, java.lang.String title)
          Static convenience method for plotting a vector.
static void plot(float[] vector, java.lang.String title)
          Static convenience method for plotting a vector.
static void plot(Function function, float start, float increment, float end, java.lang.String title)
          Static convenience method for plotting a Function.
static void plot(java.util.List<TimeSeries> series, java.util.List<SpikePattern> patterns, java.lang.String title)
          Plots multiple TimeSeries and/or SpikePatterns together in the same plot.
static void plot(NEFEnsemble ensemble)
          Static convenience method for producing a plot of CONSTANT_RATE responses over range of inputs.
static void plot(NEFEnsemble ensemble, java.lang.String origin)
          Static convenience method for producing a decoding error plot of an NEFEnsemble origin.
static void plot(SpikePattern pattern)
          Static convenience method for plotting a spike raster.
static void plot(TimeSeries series, float tauFilter, java.lang.String title)
          As plot(TimeSeries) but series is filtered before plotting.
static void plot(TimeSeries series, java.lang.String title)
          Static convenience method for producing a TimeSeries plot.
static void plot(TimeSeries ideal, TimeSeries actual, float tauFilter, java.lang.String title)
          Plots ideal and actual TimeSeries' together, with each series filtered before plotting.
static void plot(TimeSeries ideal, TimeSeries actual, java.lang.String title)
          Plots ideal and actual TimeSeries' together.
 void showPlot(javax.swing.JPanel plotPanel, java.lang.String title)
          Display a new plot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plotter

public Plotter()
Method Detail

showPlot

public void showPlot(javax.swing.JPanel plotPanel,
                     java.lang.String title)
Display a new plot.

Parameters:
plotPanel - A panel containng the plot image
title - The plot title

createFrame

public javax.swing.JFrame createFrame()
Returns:
A new JFrame to hold a plot

closeAll

public static void closeAll()
Close all open plots


plot

public static void plot(TimeSeries series,
                        java.lang.String title)
Static convenience method for producing a TimeSeries plot.

Parameters:
series - TimeSeries to plot
title - Plot title

plot

public static void plot(TimeSeries series,
                        float tauFilter,
                        java.lang.String title)
As plot(TimeSeries) but series is filtered before plotting. This is useful when plotting NEFEnsemble output (which may consist of spikes) in a manner more similar to the way it would appear within post-synaptic neurons.

Parameters:
series - TimeSeries to plot
tauFilter - Time constant of display filter (s)
title - Plot title

filter

public static TimeSeries filter(TimeSeries series,
                                float tauFilter)
Parameters:
series - A TimeSeries to which to apply a 1-D linear filter
tauFilter - Filter time constant
Returns:
Filtered TimeSeries

plot

public static void plot(TimeSeries ideal,
                        TimeSeries actual,
                        java.lang.String title)
Plots ideal and actual TimeSeries' together.

Parameters:
ideal - Ideal time series
actual - Actual time series
title - Plot title

plot

public static void plot(java.util.List<TimeSeries> series,
                        java.util.List<SpikePattern> patterns,
                        java.lang.String title)
Plots multiple TimeSeries and/or SpikePatterns together in the same plot.

Parameters:
series - A list of TimeSeries to plot (can be null if none)
patterns - A list of SpikePatterns to plot (can be null if none)
title - Plot title

plot

public static void plot(TimeSeries ideal,
                        TimeSeries actual,
                        float tauFilter,
                        java.lang.String title)
Plots ideal and actual TimeSeries' together, with each series filtered before plotting.

Parameters:
ideal - Ideal time series
actual - Actual time series
tauFilter - Time constant of display filter (s)
title - Plot title

doPlot

public abstract void doPlot(TimeSeries series,
                            java.lang.String title)
Parameters:
series - TimeSeries to plot
title - Plot title

doPlot

public abstract void doPlot(TimeSeries ideal,
                            TimeSeries actual,
                            java.lang.String title)
Parameters:
ideal - Ideal time series
actual - Actual time series
title - Plot title

doPlot

public abstract void doPlot(java.util.List<TimeSeries> series,
                            java.util.List<SpikePattern> patterns,
                            java.lang.String title)
Parameters:
series - A list of TimeSeries to plot (can be null if none)
patterns - A list of SpikePatterns to plot (can be null if none)
title - Plot title

plot

public static void plot(NEFEnsemble ensemble,
                        java.lang.String origin)
Static convenience method for producing a decoding error plot of an NEFEnsemble origin.

Parameters:
ensemble - NEFEnsemble from which origin arises
origin - Name of origin (must be a DecodedOrigin, not one derived from a combination of neuron origins)

doPlot

public abstract void doPlot(NEFEnsemble ensemble,
                            java.lang.String origin)
Parameters:
ensemble - NEFEnsemble from which origin arises
origin - Name of origin (must be a DecodedOrigin, not one derived from a combination of neuron origins)

plot

public static void plot(NEFEnsemble ensemble)
Static convenience method for producing a plot of CONSTANT_RATE responses over range of inputs.

Parameters:
ensemble - An NEFEnsemble

doPlot

public abstract void doPlot(NEFEnsemble ensemble)
Parameters:
ensemble - An NEFEnsemble

plot

public static void plot(SpikePattern pattern)
Static convenience method for plotting a spike raster.

Parameters:
pattern - SpikePattern to plot

doPlot

public abstract void doPlot(SpikePattern pattern)
Parameters:
pattern - A SpikePattern for which to plot a raster

plot

public static void plot(Function function,
                        float start,
                        float increment,
                        float end,
                        java.lang.String title)
Static convenience method for plotting a Function.

Parameters:
function - Function to plot
start - Minimum of input range
increment - Size of incrememnt along input range
end - Maximum of input range
title - Display title of plot

doPlot

public abstract void doPlot(Function function,
                            float start,
                            float increment,
                            float end,
                            java.lang.String title)
Parameters:
function - Function to plot
start - Minimum of input range
increment - Size of incrememnt along input range
end - Maximum of input range
title - Display title of plot

plot

public static void plot(float[] vector,
                        java.lang.String title)
Static convenience method for plotting a vector.

Parameters:
vector - Vector of points to plot
title - Display title of plot

doPlot

public abstract void doPlot(float[] vector,
                            java.lang.String title)
Parameters:
vector - Vector of points to plot
title - Display title of plot

plot

public static void plot(float[] domain,
                        float[] vector,
                        java.lang.String title)
Static convenience method for plotting a vector.

Parameters:
domain - Vector of domain values
vector - Vector of range values
title - Display title of plot

doPlot

public abstract void doPlot(float[] domain,
                            float[] vector,
                            java.lang.String title)
Parameters:
domain - Vector of domain values
vector - Vector of range values
title - Display title of plot