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

Axis* axis_create ( Plot plot,
gint  orientation,
AXIS_TYPE  type 
)

Create an axis, including labels and locations of tick-marks.

Parameters:
plot The Plot for which the axis is being created.
orientation Either X_AXIS or Y_AXIS.
Returns:
A completed axis structure.

Definition at line 578 of file axis.c.

References axis_calc_height(), axis_calc_ticks(), axis_calc_width(), _Axis::font, _Axis::gc, _Axis::height, _Axis::orientation, _Axis::ticks, _Axis::type, _Axis::width, X_AXIS, _Plot::x_range, and _Plot::y_range.

Referenced by plot_axes_create().

{
  Axis* axis;

  YDEB("axis_create\n");
  axis = g_malloc(sizeof(Axis));
  axis->font=NULL;
  axis->gc=NULL;
  axis->ticks=NULL;
  axis->orientation = orientation;
  axis->type = type;
  axis->font = gdk_font_load(DEFAULT_AXIS_FONT);

  if (orientation == X_AXIS)
    axis->ticks = axis_calc_ticks(plot->x_range[0], plot->x_range[1], axis);
  else
    axis->ticks = axis_calc_ticks(plot->y_range[0], plot->y_range[1], axis);

  axis->width = axis_calc_width(axis);
  axis->height = axis_calc_height(axis);
  
  return axis;
}


Generated by  Doxygen 1.6.0   Back to index