Table of Contents

Class: ComparativeScatterPlot Bio/Graphics/Comparative.py

Display a scatter-type plot comparing two different kinds of info.

Attributes;

  • display_info -- a 2D list of the information we'll be outputting. Each top level list is a different data type, and each data point is a two-tuple of the coordinates of a point. So if you had two distributions of points, it should look like:

display_info = [[(1, 2), (3, 4)], [(5, 6), (7, 8)]]

if everything is just one set of points, display_info can look like:

display_info = [[(1, 2), (3, 4), (5, 6)]]

Methods   
__init__
_draw_scatter_plot
_draw_title
_find_min_max
_set_colors_and_shapes
draw_to_file
  __init__ 
__init__ ( self,  output_format='pdf' )

  _draw_scatter_plot 
_draw_scatter_plot (
        self,
        cur_drawing,
        x_start,
        y_start,
        x_end,
        y_end,
        )

Draw a scatter plot on the drawing with the given coordinates.

  _draw_title 
_draw_title (
        self,
        cur_drawing,
        title,
        width,
        height,
        )

Add a title to the page we are outputting.

  _find_min_max 
_find_min_max ( self,  info )

Find the min and max for the x and y coordinates in the given data.

  _set_colors_and_shapes 
_set_colors_and_shapes (
        self,
        scatter_plot,
        display_info,
        )

Set the colors and shapes of the points displayed.

By default this just sets all of the points according to the order of colors and shapes defined in self.color_choices and self.shape_choices. The first 5 shapes and colors are unique, the rest of them are just set to the same color and shape (since I ran out of shapes!).

You can change how this function works by either changing the values of the color_choices and shape_choices attributes, or by inheriting from this class and overriding this function.

  draw_to_file 
draw_to_file (
        self,
        output_file,
        title,
        )

Write the comparative plot to a file.

Exceptions   
ValueError( "Invalid output format %s" % self.output_format )

Table of Contents

This document was automatically generated on Mon Jul 1 12:03:12 2002 by HappyDoc version 2.0.1