Hezekiah M. Carty wrote: > While writing the Cairo backend for plarc, I am having some trouble > getting the transformation from world coordinates to Cairo coordinates > correct. From what I understand, the proper method is: > > cairo_x = plP_wcpcx(world_x); > cairo_y = plP_wcpcx(world_y); > cairo_a = plP_wcpcx(world_x + world_a) - cairo_x; > cairo_b = plP_wcpcy(world_y + world_b) - cairo_y; > > Each of the "cairo_*" values would then be scaled by > "aStream->downscale" in cairo.c to get the proper dimensions. > However, this does not seem to work properly for me. I have attached > two example plots to show the issue. The plots are from slightly > modified versions of x03c.c, in which plarc is used to draw the axis > circles, as well as some filled and rotated circles around the outer > axis circle for (temporary) testing purposes. > > The first, ex03c-soft-arc.png, uses the plline and plfill fallback > code to render the circle, so the internals of those two functions > handle all of the coordinate transformation work on their own. This > illustrates how I intend the result to look. > > The second, ex03c-cairo-arc.png, uses the method described at the > start of this email to transform from world to Cairo coordinates and > then uses cairo_arc to render the circles and filled arcs. However, > the scales are incorrect. The coordinate circle radii are too large > and the filled arcs are misplaced on the plot relative to the proper > results in ex03c-soft-arc.png. > > Any thoughts on what I am missing in the coordinate transformation? I > can make the full set of code changes available if that would be > helpful.
It looks like you may have reversed the labels on your examples? I think that the cairo driver should be getting the points already appropriately transformed such that all that needs to be done is to apply the aStream->downscale scaling. To me the analogy would be the function plD_line_cairo which only applies the aStream->downscale scaling to the points that it receives from PLplot core. Or perhaps you were asking what transform to do in PLplot core? -Hazen ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel