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

gdouble j_to_y ( Plot plot,
gint  j 

Convert a plot window j-coordinate to a real y-coordinate value.

Values outside of the plot region are set to the appropriate boundary of the range.

plot The Plot.
j The j position (in pixels) of the point.
The coordinate value, along the y-axis, of the point.

Definition at line 166 of file util.c.

References _Plot::j_origin, _Plot::j_size, and _Plot::y_range.

Referenced by plot_area_write_location(), and zoom_y_range_set().

  gint j_pt;

  j_pt = MIN(plot->j_origin - j, plot->j_size);

  if (j_pt == plot->j_size)
    return plot->y_range[1];

  if (j_pt < 0)
    return plot->y_range[0];

  return plot->y_range[0]
    + (plot->y_range[1] - plot->y_range[0]) *  j_pt/plot->j_size;

Generated by  Doxygen 1.6.0   Back to index