Page Frame Bounds

This section describes the coordinate systems used by Tioga for page layout.

The "output page" is defined in "output coordinates" having units equal to 1/720 of an inch. This unit is 1/10 of a "big point" that is the basic size used in PostScript and PDF. By making the unit this size, we can write output coordinates to the PDF file as integers, getting a significant size reduction in the file without giving up noticable accuracy. The (0, 0) point of the output coordinate system is at the lower-left hand corner of the output page. The x axis increases horizontally, and the y axis increases vertically. The dimensions of the page are given by the attributes page_width and page_height. The attributes page_right and page_top are aliases for these. The attributes page_left and page_bottom are always zero. The default page size is 5 inches square, but you can set the size to anything you like using the set_device_pagesize routine.

While the output coordinates have a fixed physical size, all the other coordinate systems are relative rather than absolute. At the next level comes "page coordinates" that are defined relative to the output page with (0, 0) in page coordinates at the lower left corner of the output page and (1, 1) at the upper right. Page coordinates are used to define the location of the current "frame". The current frame location is held in the attributes frame_left, frame_right, frame_top, and frame_bottom, all in page coordinates. In addition, the attribute frame_width is defined to be frame_right - frame_left, and frame_height is frame_top - frame_bottom. The defaults are (0.2, 0.2) for the lower left corner of the frame and (0.8, 0.8) for the upper right. You can change these by calling the routine set_frame_sides.

The "frame coordinates" are defined with (0, 0) at the lower left corner of the frame and (1, 1) at the upper right. Subframes are sized and located using frame coordinates. The routine set_subframe does this job. In addition, subframes are used to give a desired aspect ratio. The routine set_aspect_ratio_relative_to_frame does this in terms of frame coordinates — in other words, it creates a subframe having the requested ratio of width to height relative to the frame. In some cases that will be what you want, but it is more common to want to specify the width to height ratio relative to the output page, i.e., in absolute rather than relative terms. This is provided by the routine set_physical_aspect_ratio (with set_aspect_ratio as an alias).

When doing a plot, you want yet another coordinate system, one that matches the data. This is called the "figure coordinate system" and is set by the "bounds" attributes that give the locations in figure coordinates of the edges of the frame. These attributes are called bounds_right, bounds_left, bounds_top, and bounds_bottom. Note that you can "reverse" the x axis, for example, by making bounds_right smaller than bounds_left. To help with the bookkeeping for this, the attribute bounds_xmin holds the minimum of bounds_left and bounds_right, while bounds_ymin has the minimum of bounds_top and bounds_bottom. Finally, bounds_width holds the absolute value of bounds_right - bounds_left and bounds_height has abs(bounds_top - bounds_bottom). The default bounds are 0 for left and bottom and 1 for right and top, making figure coordinates identical to frame coordinates. The bounds can be changed by calling the set_bounds routine.

FigureMaker methods

set_device_pagesize(width, height)  [ doc ]

set_frame_sides(left, right, top, bottom)  [ doc ]

set_subframe(left=0.0, right=0.0, top=0.0, bottom=0.0)  [ doc ]

column_margins(left_margin=0.0, right_margin=0.0, column_margin=0.0, column=None, first_column=1, last_column=None, num_columns=None)  [ doc | example ]

row_margins(top_margin=0.0, bottom_margin=0.0, row_margin=0.0, row=None, first_row=1, last_row=None, num_rows=None)  [ doc ]

set_bounds(left, right, top, bottom)  [ doc ]

convert_output_to_mm(d)  [ doc ]

convert_mm_to_output(d)  [ doc ]

convert_output_to_inches(d)  [ doc ]

convert_inches_to_output(d)  [ doc ]

convert_page_to_output_x(x)  [ doc ]

convert_page_to_output_y(y)  [ doc ]

convert_page_to_output_dx(dx)  [ doc ]

convert_page_to_output_dy(dy)  [ doc ]

convert_output_to_page_x(x)  [ doc ]

convert_output_to_page_y(y)  [ doc ]

convert_output_to_page_dx(dx)  [ doc ]

convert_output_to_page_dy(dy)  [ doc ]

convert_page_to_frame_x(x)  [ doc ]

convert_page_to_frame_y(y)  [ doc ]

convert_page_to_frame_dx(dx)  [ doc ]

convert_page_to_frame_dy(dy)  [ doc ]

convert_frame_to_page_x(x)  [ doc ]

convert_frame_to_page_y(y)  [ doc ]

convert_frame_to_page_dx(dx)  [ doc ]

convert_frame_to_page_dy(dy)  [ doc ]

convert_figure_to_frame_x(x)  [ doc ]

convert_figure_to_frame_y(y)  [ doc ]

convert_figure_to_frame_dx(dx)  [ doc ]

convert_figure_to_frame_dy(dy)  [ doc ]

convert_frame_to_figure_x(x)  [ doc ]

convert_frame_to_figure_y(y)  [ doc ]

convert_frame_to_figure_dx(dx)  [ doc ]

convert_frame_to_figure_dy(dy)  [ doc ]

convert_figure_to_output_x(x)  [ doc ]

convert_figure_to_output_dx(dx)  [ doc ]

convert_figure_to_output_dy(dy)  [ doc ]

convert_output_to_figure_x(x)  [ doc ]

convert_output_to_figure_y(y)  [ doc ]

convert_output_to_figure_dx(dx)  [ doc ]

convert_output_to_figure_dy(dy)  [ doc ]

convert_to_degrees(dx, dy)  [ doc ]

FigureMaker attributes

page_left  [ doc ]

page_right  [ doc ]

page_bottom  [ doc ]

page_top  [ doc ]

page_width  [ doc ]

page_height  [ doc ]

frame_left  [ doc ]

frame_right  [ doc ]

frame_bottom  [ doc ]

frame_top  [ doc ]

frame_width  [ doc ]

frame_height  [ doc ]

bounds_left  [ doc ]

bounds_right  [ doc ]

bounds_bottom  [ doc ]

bounds_top  [ doc ]

bounds_width  [ doc ]

bounds_height  [ doc ]

bounds_xmin  [ doc ]

bounds_xmax  [ doc ]

bounds_ymin  [ doc ]

bounds_ymax  [ doc ]

tex_preamble  [ doc ]

PyTioga version: alpha (20071021)

Copyright (C) 2007 Taro Sato & Bill Paxton. All rights reserved.