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

Class GraphModel

source code

Instance Methods [hide private]
 
__init__()
Creates a new graph model.
source code
 
new_alike()
Creates new graph model object that has the same settings as gmodel.
source code
 
get_n_curves()
Returns: number of curves in graph model.
source code
 
add_curve(curve)
Adds a new curve to a graph model.
source code
 
remove_curve_by_description(description)
Removes all the curves having same description string as description.
source code
 
remove_curve(cindex)
Removes the curve having given index.
source code
 
get_curve_by_description(description)
Returns: The first curve that has description (label) given by description (no reference is added).
source code
 
get_curve(cindex)
Gets a graph model curve by its index.
source code
 
get_curve_index(curve)
Finds the index of a graph model curve.
source code
 
remove_all_curves()
Removes all the curves from graph model
source code
 
set_units_from_data_line(data_line)
Sets x and y graph model units to match a data line.
source code
 
x_data_can_be_logarithmed()
Checks whehter x axis can be lograrithmed.
source code
 
y_data_can_be_logarithmed()
Checks whehter y axis can be lograrithmed.
source code
 
set_axis_label(pos, label)
Sets one axis label of a graph model.
source code
 
get_axis_label(pos)
Gets the label of a one graph model axis.
source code
 
get_x_range(x_min, x_max)
Gets the abscissa range of a graph.
source code
 
get_y_range(y_min, y_max)
Gets the ordinate range of a graph.
source code
 
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.
source code
 
UNIMPLEMENTED_export_ascii(export_units, export_labels, export_metadata, export_style, string)
Exports a graph model data to a file.
source code
Method Details [hide private]

__init__()
(Constructor)

source code 

Creates a new graph model.

Returns:
New graph model as a GObject.

new_alike()

source code 

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.

get_n_curves()

source code 
Returns:
number of curves in graph model.

add_curve(curve)

source code 

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.

remove_curve_by_description(description)

source code 

Removes all the curves having same description string as description.

Parameters:
  • description - Curve description (label). (string)
Returns:
The number of removed curves.

remove_curve(cindex)

source code 

Removes the curve having given index.

Parameters:
  • cindex - Curve index in graph model. (int)

get_curve_by_description(description)

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

get_curve(cindex)

source code 

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_index(curve)

source code 

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.

remove_all_curves()

source code 

Removes all the curves from graph model

set_units_from_data_line(data_line)

source code 

Sets x and y graph model units to match a data line.

Parameters:
  • data_line - A data line to take units from. (DataLine)

x_data_can_be_logarithmed()

source code 

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()

source code 

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).

set_axis_label(pos, label)

source code 

Sets one axis label of a graph model.

Parameters:
  • pos - Axis position. (GtkPositionType)
  • label - The new label. (string)

get_axis_label(pos)

source code 

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_x_range(x_min, x_max)

source code 

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)

source code 

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.

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

source code 

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

See Graph.curve_model_get_ranges() for discussion.

Since: 2.8

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.

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

source code 

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.