Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::Graphics::Distribution::DistributionPage::draw (   self,
  output_file,
  title 
)

Draw out the distribution information.

Arguments:

o output_file - The name of the file to output the information to.

o title - A title to display on the graphic.

Definition at line 41 of file Distribution.py.

00041                                       :
        """Draw out the distribution information.

        Arguments:

        o output_file - The name of the file to output the information to.

        o title - A title to display on the graphic.
        """
        width, height = self.page_size
        cur_drawing = Drawing(width, height)

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

        # calculate the x and y position changes for each distribution
        cur_x_pos = inch * .5
        end_x_pos = width - inch * .5
        cur_y_pos = height - 1.5 * inch
        end_y_pos = .5 * inch
        x_pos_change = ((end_x_pos - cur_x_pos) /
                        float(self.number_of_columns))
        num_y_rows = math.ceil(float(len(self.distributions))
                               / float(self.number_of_columns))
        y_pos_change = (cur_y_pos - end_y_pos) / num_y_rows
        
        self._draw_distributions(cur_drawing, cur_x_pos, x_pos_change,
                                 cur_y_pos, y_pos_change, num_y_rows)
        self._draw_legend(cur_drawing, 2.5 * inch, width)

        if self.output_format == 'pdf':
            out_canvas = canvas.Canvas(output_file, pagesize = self.page_size)
            renderPDF.draw(cur_drawing, out_canvas, 0, 0)
            out_canvas.showPage()
            out_canvas.save()
        elif self.output_format == 'eps':
            renderPS.drawToFile(cur_drawing, output_file)
        else:
            raise ValueError("Invalid output format %s" % self.output_format)


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


Generated by  Doxygen 1.6.0   Back to index