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

Class GraphArea

source code

Instance Methods [hide private]
 
__init__()
Creates a new graph area widget.
source code
 
get_label()
Gets the label inside a graph area.
source code
 
set_model(gmodel)
Sets the graph model of a graph area.
source code
 
get_model()
Gets the model of a graph area.
source code
 
get_cursor()
Gets mouse cursor related values within a graph area.
source code
 
set_x_range(x_min, x_max)
Sets the horizontal range a graph area displays.
source code
 
set_y_range(y_min, y_max)
Sets the vertical range a graph area displays.
source code
 
get_selection(status_type)
Gets the selection object corresponding to a status of a graph area.
source code
 
set_status(status_type)
Sets the status of a graph area.
source code
 
get_status()
Gets the status of a grap area.
source code
 
draw_on_drawable(drawable, gc, x, y, width, height)
Draws a graph area to a Gdk drawable.
source code
 
export_vector(x, y, width, height)
Creates PostScript representation of a graph area.
source code
 
enable_user_input(enable)
Enables/disables auxiliary graph area dialogs (invoked by clicking the mouse).
source code
 
set_selection_editable(setting)
Enables/disables selection editing using mouse.
source code
 
edit_curve(id)
Invokes the curve property dialog for a curve.
source code
 
set_x_grid_data(grid_data)
Sets the grid data on the x-axis of a graph area
source code
 
set_y_grid_data(grid_data)
Sets the grid data on the y-axis of a graph area
source code
 
get_x_grid_data()
Gets the grid data on the x-axis of a graph area.
source code
 
get_y_grid_data()
Gets the grid data on the y-axis of a graph area.
source code
Method Details [hide private]

__init__()
(Constructor)

source code 

Creates a new graph area widget.

Returns:
Newly created graph area as GtkWidget. (gtk.Widget)

get_label()

source code 

Gets the label inside a graph area.

Returns:
The graph label widget within the graph area. (gtk.Widget)

set_model(gmodel)

source code 

Sets the graph model of a graph area.

Parameters:

get_model()

source code 

Gets the model of a graph area.

Returns:
The graph model this graph area widget displays. (GraphModel)

get_cursor()

source code 

Gets mouse cursor related values within a graph area.

Returns:
Tuple consisting of 2 values (x_cursor, y_cursor). ((float), (float))

set_x_range(x_min, x_max)

source code 

Sets the horizontal range a graph area displays.

Parameters:
  • x_min - The minimum x value, in real coodrinates. (float)
  • x_max - The maximum x value, in real coodrinates. (float)

set_y_range(y_min, y_max)

source code 

Sets the vertical range a graph area displays.

Parameters:
  • y_min - The minimum y value, in real coodrinates. (float)
  • y_max - The maximum y value, in real coodrinates. (float)

get_selection(status_type)

source code 

Gets the selection object corresponding to a status of a graph area.

A selection object exists even for inactive status types (selection modes), therefore also selections for other modes than the currently active one can be requested.

Parameters:
  • status_type - Graph status. Value GRAPH_STATUS_PLAIN mode (which has no selection associated) stands for the currentl selection mode. Expected values: GRAPH_STATUS_PLAIN, GRAPH_STATUS_XSEL, GRAPH_STATUS_YSEL, GRAPH_STATUS_POINTS, GRAPH_STATUS_ZOOM, GRAPH_STATUS_XLINES, GRAPH_STATUS_YLINES. (GraphStatusType)
Returns:
The requested selection. It is None only if status_type is GRAPH_STATUS_PLAIN and the current selection mode is GRAPH_STATUS_PLAIN. (Selection)

set_status(status_type)

source code 

Sets the status of a graph area.

When the area is inside a Graph, use Graph.set_status() instead (also see this function for details).

Parameters:
  • status_type - New graph area status. Expected values: GRAPH_STATUS_PLAIN, GRAPH_STATUS_XSEL, GRAPH_STATUS_YSEL, GRAPH_STATUS_POINTS, GRAPH_STATUS_ZOOM, GRAPH_STATUS_XLINES, GRAPH_STATUS_YLINES. (GraphStatusType)

get_status()

source code 

Gets the status of a grap area.

See Graph.area_set_status().

Returns:
The current graph area status. (GraphStatusType)

draw_on_drawable(drawable, gc, x, y, width, height)

source code 

Draws a graph area to a Gdk drawable.

Parameters:
  • drawable - a GdkDrawable (destination for graphics operations) (gdk.Drawable)
  • gc - Graphics context. It is modified by this function unpredictably. (gdk.GC)
  • x - X position in drawable where the graph area should be drawn (int)
  • y - Y position in drawable where the graph area should be drawn (int)
  • width - width of the graph area on the drawable (int)
  • height - height of the graph area on the drawable (int)

export_vector(x, y, width, height)

source code 

Creates PostScript representation of a graph area.

Parameters:
  • x - Bounding box origin X-coordinate. (int)
  • y - Bounding box origin Y-coordinate. (int)
  • width - Bounding box width. (int)
  • height - Bounding box height. (int)
Returns:
A fragment of PostScript code representing the the graph area as a newly allocated GString. (string)

enable_user_input(enable)

source code 

Enables/disables auxiliary graph area dialogs (invoked by clicking the mouse).

Note, however, that this setting does not control editability of selections. Use Graph.area_set_selection_editable() for that.

Parameters:
  • enable - True to enable user interaction, False to disable it. (bool)

set_selection_editable(setting)

source code 

Enables/disables selection editing using mouse.

When selection editing is disabled the graph area status type determines the selection type that can be drawn on the area. However, the user cannot modify it.

Parameters:
  • setting - True to enable selection editing, False to disable it. (bool)

Since: 2.45

edit_curve(id)

source code 

Invokes the curve property dialog for a curve.

If the dialog is already displayed, it is switched to the requested curve.

Parameters:
  • id - The index of the curve to edit properties of. (int)

Since: 2.5

set_x_grid_data(grid_data)

source code 

Sets the grid data on the x-axis of a graph area

Parameters:
  • grid_data - Array of grid line positions on the x-axis (in real values, not pixels). (list)

set_y_grid_data(grid_data)

source code 

Sets the grid data on the y-axis of a graph area

Parameters:
  • grid_data - Array of grid line positions on the y-axis (in real values, not pixels). (list)

get_x_grid_data()

source code 

Gets the grid data on the x-axis of a graph area.

Returns:
Array of grid line positions (in real values, not pixels) owned by the graph area. (list)

get_y_grid_data()

source code 

Gets the grid data on the y-axis of a graph area.

Returns:
Array of grid line positions (in real values, not pixels) owned by the graph area. (list)