On Aug 23, 2008, at 9:01 PM, Alan W. Irwin wrote:
On 2008-08-23 17:18-0400 Hazen Babcock wrote:I agree that this (3D text) problem exists and it is pretty easy to see if you also draw circles on the plot. However I am not so sure what to do about it. [...]In the case of 2D text we are not stretching or contracting the baseline of the text to allow for the relative x-y scales of the plot.I confirmed this with the attached 2D test version of xw28.py with xscale very different from yscale. What is essentially going on is the charactersare written in their own semi-independent coordinate system with thecharacter spacing in the direction of writing a constant when expressed in device coordinates. So the "n" in revolution describes a 2D circle ratherthan an ellipse regardless of x or y scale. And if the viewport isrectangular, the "n" in revolution still describes a 2D circle. I thinkthis 2D behaviour is fine so I would like to get as close to that aspossible in the 3D case, and it turns out (see below) we have that idealbehaviour for -dev xcairo, but not quite yet for -dev xwin.(out of order) If you take an extreme example where you've almost gone back to a 2D plot with azimuth = altitude = 5 then you will see the text makes a nice circle but if it is to fit properly in the bounding box then it should in fact be an oval. In the case of 2D text we are not stretching or contracting the baseline of the text to allow for the relative x-y scales of the plot. Do we want to dothis with 3D text?That's an excellent last question. Indeed, the 2D case has clarifiedmy thoughts, and I think you should always expect to see the text make anice circle (I confirm that it does) at low alt, az even if the box is rectangular (like it normally is).So to my mind the low alt, az behaviour is fine, and the question is whether we have the correct behaviour at other alt, az. One way to test that is tomake sure the effective box is square at low alt, az and change thecharacter size so the circular "revolution" text is nicely inscribed by that square. Then as alt and az are changed, the text should continue to benicely inscribed by the 3D square.I attach a second test case variation of xw28.py that illustrates that we donot quite have the correct behaviour for arbitrary alt, az. (I haveadjusted plvpor and plwind arguments so that the x and y coordinates have the same range. You also need to run this test with "square" geometry, e.g., -geometry 600x600 to assure a square box at low alt, az. You mayalso have to adjust charsize to get an exactly inscribed box for both-dev xwin and -dev xcairo since your screen resolution is probably differentthan mine.) The attached version has alt=0.1 az=0.1I run this test by editing the test version of xw28.py to adjust charsize (appropriate to the device driver) and alt, az, and then runningeither ./x28 -dev xwin -geometry 600x600 or ./x28 -dev xcairo -geometry 600x600 in the _installed_ examples/python directory.I hope you have python available so you can run the same tests, but if not it should be fairly straightforward to adjust the C version of the exampleto give "inscribed square" results.In fact, for the 3D test case, the correct behaviour is seen as you vary alt from 0.1 to 80.1 for fixed az=0.1 for both -dev xwin and -dev xcairo. And, if you do the same sequence in az for fixed alt=0.1, you get good behaviour as well for -dev xcairo. I am sure you will agree with me that this isgreatly encouraging news.However, the az sequence gives slightly incorrect behaviour (some parts ofthe "n" slop outside the 3D square at certain angles, and the expectedangular symmetry in how close the "n" comes to the box is slightly lost) for-dev xwin.If you have -dev xwin available on your platform, I hope you can verify the slightly bad behaviour I see. If not, I can send you a screenshot. IIRC, -dev xcairo takes a different PLplot core code path than -dev xwin so you can get correct 3D text results for one but not the other (which appears tobe the case here).
Now that I've finally figured out how to run the python examples you sent (thanks for the help here) I've can verify what you are seeing. To pick an example, at alt = 0.1, az = 22, it looks to me like (for the xwin driver) the horizontal and vertical text is properly drawn but the text slightly above (and slightly below) horizontal is extending outside of the box. Is that what you are referring to? My example is attached.
-Hazen
<<inline: awi1.png>>
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel