diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 6b03f8ec0..5f6720cb7 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -668,7 +668,7 @@ X_ScreentoData(GRAPH *graph, int x, int y, double *fx, double *fy) { lmin = log10(graph->datawindow.ymin); lmax = log10(graph->datawindow.ymax); - *fy = exp(((graph->absolute.height - y - graph->viewportxoff) + *fy = exp(((graph->absolute.height - y - graph->viewportyoff) * (lmax - lmin) / graph->viewport.height + lmin) * M_LN10); } else { diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index ed08fb571..63f6177e9 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -1017,7 +1017,7 @@ static void WIN_ScreentoData(GRAPH *graph, int x, int y, double *fx, double *fy) { lmin = log10(graph->datawindow.ymin); lmax = log10(graph->datawindow.ymax); - *fy = exp(((graph->absolute.height - y - graph->viewportxoff) * + *fy = exp(((graph->absolute.height - y - graph->viewportyoff) * (lmax - lmin) / graph->viewport.height + lmin) * M_LN10); } else { *fy = ((graph->absolute.height - y) - graph->viewportyoff) *