From: Robert P. <rob...@jk...> - 2008-10-14 10:07:34
|
Alan W. Irwin wrote: >> I tried the following, but it gives >> me ellipses, e.g. when called in x12c.c: [...] >> /* get axis ratio */ >> plgvpw(&vpxmin, &vpxmax, &vpymin, &vpymax); >> ratio = (vpxmax -vpxmin) / (vpymax -vpymin); > > What you appear to need is something that returns real device units > (whether they are in pixels, points, or mm doesn't matter since it is > only the ratio the determines the aspect ratio). I therefore suggest > you try plgspa or plgpage. Thank you - the following works for me: /* get ratio s.t. ellipse appears as circle */ plgvpw(&vpxmin, &vpxmax, &vpymin, &vpymax); axisratio = (vpxmax -vpxmin) / (vpymax -vpymin); plgpage(&px, &py, &pxlen, &pylen, &pxoff, &pyoff); pageratio = pxlen * 1. / pylen; ratio = axisratio / pageratio; -- Robert |