Logo Search packages:      
Sourcecode: ygraph version File versions  Download package

void frame_append_data_point ( Frame frame,
gdouble  x_val,
gdouble  y_val 
)

Append a data point to a frame, resetting the max and mins.

The new point is added to the Frame, and the corresponding data ranges are modified.

Parameters:
frame The frame to which the point is to be appended.
x_val The coordinate x-value of the point.
y_val The coordinate y-value of the point.

Definition at line 283 of file read_data.c.

References _Frame::npoints, _Frame::x_range, _Frame::xy_data, and _Frame::y_range.

Referenced by dataset_read_from_file(), and frame_derivative().

{
  gdouble* point;

  point = g_malloc(2*sizeof(gdouble));
  *point = x_val;
  *(point+1) = y_val;

  g_array_append_val(frame->xy_data, point);

  frame->x_range[0] = MIN(frame->x_range[0], x_val);
  frame->x_range[1] = MAX(frame->x_range[1], x_val);
  frame->y_range[0] = MIN(frame->y_range[0], y_val);
  frame->y_range[1] = MAX(frame->y_range[1], y_val);

  ++(frame->npoints);
}


Generated by  Doxygen 1.6.0   Back to index