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

void axis_toggle_log_state ( Plot plot  ) 

Switch between axis states log<->linear.

Parameters:
plot The Plot whose axes are to be toggled.

Definition at line 1062 of file axis.c.

References AXIS_LINEAR, AXIS_LOG, plot_axes_create(), plot_range_set(), plot_window_display_all(), plot_window_reconfigure(), _Axis::type, _Plot::x_axis, and _Plot::y_axis.

Referenced by plot_window_key_press_event().

{
  if (plot == NULL)
    return;

  if (plot->x_axis->type == AXIS_LINEAR)
    {
     if (plot->y_axis->type == AXIS_LINEAR)
       plot->y_axis->type = AXIS_LOG;
     else
       plot->x_axis->type = AXIS_LOG;
    }
  else
    {
      if (plot->y_axis->type == AXIS_LOG)
        plot->y_axis->type = AXIS_LINEAR;
      else
        plot->x_axis->type = AXIS_LINEAR;
    }

  plot_range_set(plot, RESCALE_DATA);

  plot_axes_create(plot);
  plot_window_reconfigure(plot);
  plot_window_display_all(plot);
}


Generated by  Doxygen 1.6.0   Back to index