Module gwy :: Class Axis
[hide private]
[frames] | no frames]

Class Axis

source code

Instance Methods [hide private]
 
__init__(orientation)
Creates a new axis.
source code
 
set_logarithmic(is_logarithmic)
Sets logarithmic mode.
source code
 
set_visible(is_visible)
Sets the visibility of an axis.
source code
 
is_visible()
Determines whether axis is set to be visible.
source code
 
is_logarithmic()
Determines whether axis is set to be locarithmic.
source code
 
get_orientation()
Gets the orientation of an axis.
source code
 
set_auto(is_auto)
Enables or disables automatic axis adjustmet.
source code
 
request_range(min, max)
Sets the requisition of axis boundaries.
source code
 
get_range()
Gets the actual boundaries of an axis.
source code
 
get_requested_range()
Gets the requested boundaries of an axis.
source code
 
get_magnification()
Gets the magnification value of a graph axis.
source code
 
get_magnification_string()
Gets the magnification string of an axis.
source code
 
set_label(label)
Sets the label text of an axis.
source code
 
get_label()
Gets the label of an axis.
source code
 
set_si_unit(unit)
Sets the axis unit.
source code
 
enable_label_edit(enable)
Enables/disables user to change axis label by clicking on axis widget.
source code
 
draw_on_drawable(drawable, gc, xmin, ymin, width, height)
Draws the x and y-axis on a drawable
source code
 
export_vector(xmin, ymin, width, height, fontsize)
Renders a graph axis in PostScript.
source code
 
get_major_ticks()
Gets the positions of major ticks of an axis.
source code
Method Details [hide private]

__init__(orientation)
(Constructor)

source code 

Creates a new axis.

Parameters:
  • orientation - axis orientation (int)
Returns:
New axis as a GtkWidget. (gtk.Widget)

set_logarithmic(is_logarithmic)

source code 

Sets logarithmic mode.

Parameters:
  • is_logarithmic - logarithmic mode (bool)

set_visible(is_visible)

source code 

Sets the visibility of an axis.

Parameters:
  • is_visible - visibility (bool)

is_visible()

source code 

Determines whether axis is set to be visible.

Return: True if axis is set to be visible.

Returns:
(bool)

is_logarithmic()

source code 

Determines whether axis is set to be locarithmic.

Returns:
True if axis is logarithmic. (bool)

get_orientation()

source code 

Gets the orientation of an axis.

Returns:
The orientation. (GtkPositionType)

set_auto(is_auto)

source code 

Enables or disables automatic axis adjustmet.

Parameters:
  • is_auto - True to enable automatic tick size and distribution adjustment, False to disable it. (bool)

request_range(min, max)

source code 

Sets the requisition of axis boundaries.

The axis will adjust the boundaries to satisfy requisition but still have reasonable tick values and spacing. Use Axis.get_range() to obtain the boundaries the axis actually decided to use.

Parameters:
  • min - Minimum requisition (min boundary value). (float)
  • max - Maximum requisition (max boundary value). (float)

get_range()

source code 

Gets the actual boundaries of an axis.

Returns:
Tuple consisting of 2 values (min, max). ((float), (float))

get_requested_range()

source code 

Gets the requested boundaries of an axis.

Returns:
Tuple consisting of 2 values (min, max). ((float), (float))

get_magnification()

source code 

Gets the magnification value of a graph axis.

Returns:
Magnification value of the axis. (float)

get_magnification_string()

source code 

Gets the magnification string of an axis.

Returns:
Magnification string of the axis, owned by the axis. (string)

set_label(label)

source code 

Sets the label text of an axis.

Parameters:
  • label - The new label text (it can be None for an empty label). (string)

get_label()

source code 

Gets the label of an axis.

Returns:
Axis label as a string owned by axis. (string)

set_si_unit(unit)

source code 

Sets the axis unit. This will be added automatically to the label. unit is duplicated.

Parameters:

enable_label_edit(enable)

source code 

Enables/disables user to change axis label by clicking on axis widget.

Parameters:
  • enable - enable/disable user to change axis label (bool)

draw_on_drawable(drawable, gc, xmin, ymin, width, height)

source code 

Draws the x and y-axis on a drawable

Parameters:
  • drawable - Drawable to draw on. (gdk.Drawable)
  • gc - Graphics context. It is modified by this function unpredictably. (gdk.GC)
  • xmin - The minimum x-axis value. (int)
  • ymin - The minimum y-axis value. (int)
  • width - The width of the x-axis. (int)
  • height - The height of the y-axis. (int)

export_vector(xmin, ymin, width, height, fontsize)

source code 

Renders a graph axis in PostScript.

This is a helper functions for Graph.export_postscript() and probably not useful anywhere else.

Parameters:
  • xmin - Left edge of the bounding rectangle. (int)
  • ymin - Bottom edge of the bounding rectangle. (int)
  • width - Width of the bounding rectangle. (int)
  • height - Height of the bounding rectangle. (int)
  • fontsize - Font size to use. (int)
Returns:
A newly created GString. (string)

get_major_ticks()

source code 

Gets the positions of major ticks of an axis.

Returns:
The positions of axis major ticks (as real values, not pixels). The returned array is owned by the axis. (list)