Module gwy :: Class GraphModel
[show private | hide private]
[frames | no frames]

Class GraphModel


GraphModel The ::curve-data-changed signal is emitted whenever any of the curves in a graph model emits GObject::notify.

('gwygraphmodel', ' The #GwyGraphModel which received the signal. ')

('arg1', ' The index of the changed curve in the model. ')

('arg2', ' The #GParamSpec of the property that has changed. ')
Method Summary
  __init__()
Creates a new graph model.
  add_curve(curve)
Adds a new curve to a graph model.
  get_axis_label(pos)
Gets the label of a one graph model axis.
  get_curve(cindex)
Gets a graph model curve by its index.
  get_curve_by_description(description)
Return the first curve that has description (label) given by description (no reference is added).
  get_curve_index(curve)
Finds the index of a graph model curve.
  get_n_curves()
Return number of curves in graph model.
  get_ranges(x_logscale, y_logscale, x_min, x_max, y_min, y_max)
Gets the log-scale suitable range minima of a graph curve.
  get_x_range(x_min, x_max)
Gets the abscissa range of a graph.
  get_y_range(y_min, y_max)
Gets the ordinate range of a graph.
  new_alike()
Creates new graph model object that has the same settings as gmodel.
  remove_all_curves()
Removes all the curves from graph model
  remove_curve(cindex)
Removes the curve having given index.
  remove_curve_by_description(description)
Removes all the curves having same description string as description.
  set_axis_label(pos, label)
Sets one axis label of a graph model.
  set_units_from_data_line(data_line)
Sets x and y graph model units to match a data line.
  UNIMPLEMENTED_export_ascii(export_units, export_labels, export_metadata, export_style, string)
Exports a graph model data to a file.
  x_data_can_be_logarithmed()
Checks whehter x axis can be lograrithmed.
  y_data_can_be_logarithmed()
Checks whehter y axis can be lograrithmed.

Method Details

__init__()
(Constructor)

Creates a new graph model.
Returns:
New graph model as a GObject.

add_curve(curve)

Adds a new curve to a graph model.
Parameters:
curve - A GraphCurveModel representing the curve to add. (GraphCurveModel*)
Returns:
The index of the added curve in gmodel.

get_axis_label(pos)

Gets the label of a one graph model axis.
Parameters:
pos - Axis position. (GtkPositionType)
Returns:
The label as a string owned by the model.

get_curve(cindex)

Gets a graph model curve by its index.
Parameters:
cindex - Curve index in graph model. (int)
Returns:
The curve with index cindex (no reference is added).

get_curve_by_description(description)

Parameters:
description - Curve description (label). (string)
Returns:
The first curve that has description (label) given by description (no reference is added).

get_curve_index(curve)

Finds the index of a graph model curve.
Parameters:
curve - A curve model present in gmodel to find. (GraphCurveModel*)
Returns:
The index of curve in gmodel, -1 if it is not present there.

get_n_curves()

Returns:
number of curves in graph model.

get_ranges(x_logscale, y_logscale, x_min, x_max, y_min, y_max)

Gets the log-scale suitable range minima of a graph curve.

See Graph.curve_model_get_ranges() for discussion.
Parameters:
x_logscale - True if logarithmical scale is intended for the abscissa. (bool)
y_logscale - True if logarithmical scale is intended for the ordinate. (bool)
x_min - Location to store the minimum abscissa value, or NULL. (float)
x_max - Location to store the maximum abscissa value, or NULL. (float)
y_min - Location to store the minimum ordinate value, or NULL. (float)
y_max - Location to store the maximum ordinate value, or NULL. (float)
Returns:

True if all requested output arguments were filled with the ranges.

Since: 2.8

get_x_range(x_min, x_max)

Gets the abscissa range of a graph.

Explicitly set minimum and maximum range properties take precedence over values calculated from curve abscissa ranges.
Parameters:
x_min - Location to store the minimum abscissa value, or NULL. (float)
x_max - Location to store the maximum abscissa value, or NULL. (float)
Returns:
True if the requested values were filled, False is there are no data points and the ranges are not explicitly set.

get_y_range(y_min, y_max)

Gets the ordinate range of a graph.

Explicitly set minimum and maximum range properties take precedence over values calculated from curve ordinate ranges.
Parameters:
y_min - Location to store the minimum ordinate value, or NULL. (float)
y_max - Location to store the maximum ordinate value, or NULL. (float)
Returns:
True if the requested values were filled, False is there are no data points and the ranges are not explicitly set.

new_alike()

Creates new graph model object that has the same settings as gmodel.

This includes axis/label visibility, actual plotting range, etc. Curves are not duplicated or referenced.
Returns:
New graph model.

remove_all_curves()

Removes all the curves from graph model

remove_curve(cindex)

Removes the curve having given index.
Parameters:
cindex - Curve index in graph model. (int)

remove_curve_by_description(description)

Removes all the curves having same description string as description.
Parameters:
description - Curve description (label). (string)
Returns:
The number of removed curves.

set_axis_label(pos, label)

Sets one axis label of a graph model.
Parameters:
pos - Axis position. (GtkPositionType)
label - The new label. (string)

set_units_from_data_line(data_line)

Sets x and y graph model units to match a data line.
Parameters:
data_line - A data line to take units from. (DataLine)

UNIMPLEMENTED_export_ascii(export_units, export_labels, export_metadata, export_style, string)

Exports a graph model data to a file.

The export format is specified by parameter export_style.
Parameters:
export_units - True to export units in the column header. (bool)
export_labels - True to export labels in the column header. (bool)
export_metadata - True to export all graph metadata within file header. (bool)
export_style - File format subtype to export to (e. g. plain, csv, gnuplot, etc.). (GraphModelExportStyle)
string - A string to append the text dump to, or NULL to allocate a new string. (GString*)
Returns:
Either string itself if it was not NULL, or a newly allocated GString.

x_data_can_be_logarithmed()

Checks whehter x axis can be lograrithmed.
Returns:
True if all x-values are greater than zero (thus logarithmic display of x-data is feasible).

y_data_can_be_logarithmed()

Checks whehter y axis can be lograrithmed.
Returns:
True if all y-values are greater than zero (thus logarithmic display of y-data is feasible).

Generated by Epydoc 2.1 on Tue Dec 30 04:01:42 2008 http://epydoc.sf.net