Table of Contents

Class: RowColorMapper compClust/IPlot.py

This Class provides a very flexible dynamically adjustable color mapper. Several methods are supplied to set colors by, in essence HSV color parameters can be mapped to several attributes of a dataset/labeling

Base Classes   
ColorMapper
Methods   
__init__
clearColors
getPlotColors
setColorByColValue
setColorByFunction
setColorByIndex
setColorByLabeling
setColorByLabelingCounts
setColorByTupleLabeling
setColors
  __init__ 
__init__ ( self,  plotView )

This constructor does little more than call IPlotView's constructor

  clearColors 
clearColors ( self )

clearColors(self)

clear set plot coloring.

  getPlotColors 
getPlotColors ( self )

getPlotColors(self)

An implimentation of the only required colorMapper class.

  setColorByColValue 
setColorByColValue (
        self,
        col,
        component='h',
        minValue=None,
        maxValue=None,
        colorRange=( 0,.7 ),
        )

setHueByColValue(self,col, hRange(0,1))

sets the color to be a function of the value for that row at a given column.

  setColorByFunction 
setColorByFunction (
        self,
        function,
        component='h',
        minValue=None,
        maxValue=None,
        colorRange=( 0,.7 ),
        )

setColorByFunction(self, funct, component=h, minValue, maxValue, colorRange(0,.7))

function should take in a dataset and a row and return a single float. Colors will be scaled based on that value.

function prototype should be:

value = function(dataset, row)

  setColorByIndex 
setColorByIndex (
        self,
        component='h',
        minValue=None,
        maxValue=None,
        colorRange=( 0,.7 ),
        )

setColorByFunction(self, funct)

your function needs to return a valid HSV tuple for each row of the dataset, given the dataset. ie.

[listOfColorTuples] = function(ds)

  setColorByLabeling 
setColorByLabeling (
        self,
        labeling,
        labels=None,
        component='h',
        minValue=None,
        maxValue=None,
        colorRange=( 0,.7 ),
        )

setColorByLabeling(self, labeling=None, component=h, minValue=None, maxValue=None, colorRange(0,.7))

uses the labeling to produces a color list for plotting. If the labeling contains real values, then the optional parameters minValue and maxValue can be used to scale the colorRange used. Only uses the first label attached to every row

  setColorByLabelingCounts 
setColorByLabelingCounts (
        self,
        labeling,
        component='h',
        minValue=None,
        maxValue=None,
        colorRange=( 0,.7 ),
        )

sets the given color component's value proportional to the size of the class

  setColorByTupleLabeling 
setColorByTupleLabeling (
        self,
        labeling,
        element=0,
        component='h',
        minValue=None,
        maxValue=None,
        colorRange=( 0,.7 ),
        )

setColorByTupleLabeling(self, labeling=None, component=h, minValue=None, maxValue=None, colorRange(0,.7))

uses the labeling to produces a color list for plotting. If the labeling contains real values, then the optional parameters minValue and maxValue can be used to scale the colorRange used. Only uses the first label attached to every row

  setColors 
setColors ( self,  list )

setColors(self, list)

This takes in a list of HSV tuples and sets them to be the colors for plotting.


Table of Contents

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