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

void plot_window_derivative ( Plot plot,
gint  action,
GtkItem *  button 
)

Create a new plot containing the derivative of the current plot.

Parameters:
plot The Plot whose derivative should be taken.
action The action initiating the call.
button The button initiating the call.

Definition at line 484 of file callbacks.c.

References _Plot::data, dataset_derivative(), global_data_set_list, plot_data_init(), and _Plot::window.

{
  DataSet* data_set;
  DataSet* d_data_set;
  Plot* d_plot;
  GArray* data;
  GArray* d_data;
  guint i;
  gint idx;
  gint d_data_set_idx;

  UNUSED(action);
  UNUSED(button);
  data = plot->data;
  d_data = g_array_new(FALSE, FALSE, sizeof(gint));

  for (i=0; i<data->len; ++i)
    {
      idx = g_array_index(data, gint, i);
      data_set = g_array_index(global_data_set_list, DataSet*, idx);

      d_data_set = dataset_derivative(idx);
      d_data_set_idx = global_data_set_list_append(d_data_set);

      g_array_append_val(d_data, d_data_set_idx);
    }
  
  d_plot = plot_data_init(d_data);

  gtk_widget_show(d_plot->window);
}


Generated by  Doxygen 1.6.0   Back to index