Table of Contents

Module: IPlot compClust/IPlot.py

Author: Christopher Hart Date : April, 2002

These classes provide a framework for visualization within the MLS python schema. Briefly the work horse of the toolset are two primary plotting classes IPlot and DatasetPlot built on the BLT toolkit (although other plotting backend could probably be subsituted) .

IPlot is a specialization of the Pmw.Blt.Graph widget that adds may user interface enhancements (pull down menus, sortable legends, popup information, etc).

DatasetPlot is a specialization of IPlot which adds the communication pathway for the PlotViews framework. A DatasetPlot instance can only plot when given a PlotView and they communicate via the interface defined in the IPlotView class. Through this interface custom PlotViews can be built and combined to allow for a fairly module interactive and extensible plotting enviroment.

Imported modules   
import MLab
import Numeric
import Pmw
from Scientific.Statistics import Histogram
import Tkinter
import colorsys
from compClust.mlx.datasets import Dataset
from compClust.mlx.labelings import Labeling, GlobalLabeling, GlobalWrapper, subsetByLabeling
from compClust.mlx.views import CachedView, RowAggregateFunctionView, RowPCAView, SortedView, RowSubsetView
from compClust.score import roc, ConfusionMatrix
from compClust.util import DistanceMetrics, Histogram, listOps, unique
from compClust.util.InterpreterTools import safeStdDev
import math
import operator
import re
import sys
import types
Functions   
boxPlot
plot
rgbToString
rocPlot
scaleList
startIPlot
  boxPlot 
boxPlot (
        ds,
        master=None,
        dimension=0,
        )

Generate a box plot, dimension = 0 (column-wise) dimension=1 (row-wise) ds can either be a dataset or an numeric array

  plot 
plot (
        values,
        yvalues=None,
        xerror=None,
        yerror=None,
        xmin=None,
        xmax=None,
        ymin=None,
        ymax=None,
        plotStyle="line",
        color=None,
        fileName=None,
        seriesName=None,
        previousPlot=None,
        master=None,
        pack=1,
        )

A wrapper around the IPlot class to provide a fast easy interface for plotting.

Usage: plot(x,y, <options>) This creates a plot of the x-vector vs the y-vector. x and y can be either numeric arrays r standard python lists

plot(y , <options>)

if y is a 1d array/list/tuple it creates a plot of the values vs thier index if y is a 2d array/list/tuple the values of each row is plotted as a data series vs their index if y is a dataset, it is treated like a 2d array, only a plotView and a datasetPlotter is returned.

optional Parameters: plotStyles -> on of the following: line, points, bar xmin -> float/int ymin -> float/int xmax -> float/int ymax -> float/int xerror -> NumericArray of len(values)/ if values is a 2d array, xerror should be the same size yerror -> NumericArray of len(values)/ if values is a 2d array, yerror should be the same size fileName -> name of postscript file to create color -> RGB string color (ie #FFFFFF for black) or [red, blue, green, orange, black, white, 'yellow'].

  rgbToString 
rgbToString ( rgb )

rgbToString(rgb):

turns an rgb tuple into a hex string

  rocPlot 
rocPlot (
        dataset,
        labeling,
        label,
        distanceMetric=DistanceMetrics.EuclideanDistance,
        )

draw our standard ROC plot for the label in labeling for dataset

  scaleList 
scaleList (
        values,
        minValue=None,
        maxValue=None,
        minReturn=0,
        maxReturn=1,
        )

scaleList(values, minReturn=0, maxReturn=1, minValue=None, maxValue=None)

Given a list of objects, returns a list of values returns a list of values scalled between 0 and 1 where minValue -> 0 and maxValue -> 1). If values is non-numeric each unique item is mapped arbitrarly into the 0..1 range. Values must be a list of hashable python objects

  startIPlot 
startIPlot ()

Simple Setup function to setup a psedo Tk-application for all widgets to belong to.

Classes   

AnnotationMapper

This is a support class for the IPlotView class which descrbes

BindingsMapper

ColorMapper

This is a support class for the IPlotView class which descrbes

ColumnScatterDataMapper

ColumnScatterPlotView plots two columns of a dataset against

ConfusionMatrixSummary

Generates a trajectory summary for every cell in a confusion

DatasetPlot

DatasetPlot class provides a common plotting tool for a variety

DatasetRowPlotView

This class is a general purpose plot view. Good for exploratory

HistogramPlotter

A nice interactive histogram tool.

IDataMapper

This is a support class for the IPlotView class which descrbes

IPlot

This is simply a class that adds alot of user interface stuff to the standard BLT plot.

IPlotView

IPlotView is a special compClust.View which impliments data getters

Mapper

Base class for PlotView Mapper Classes.

MarkersMapper

This is a support class for the IPlotView class which descrbes

MeanDataMapper

MeanStdDataMapper provides a view to look at the mean and std of

PCADataMapper

ColumnScatterPlotView plots two columns of a dataset against

PlotPage

A fairly simple minded scrolled frame to hold plots.

ProbabilityColorMapper

A fixed probabiliy color mapper

RowAnnotationMapper

provides a mapping of the primary and secondary annotations to

RowColorMapper

This Class provides a very flexible dynamically adjustable color

RowDataMapper

RowDataMapper(Mapper):

RowMarkersMapper

ScatterMatrix

Generates a plot page with a scatter plot between each dimension

SimpleBindingsMapper

Provides some convient acces to RowAnnotations

SortedRowDataMapper

SortedRowDataMapper(Mapper):

SummaryWindow

SummaryWindow

TrajectorySummary

A fairly simple summary very of a labeling.

pcaExplore

A simple exploritory tool to better understand the signifigance of PCA


Table of Contents

This document was automatically generated on Wed Aug 27 14:24:55 2003 by HappyDoc version 2.1