From: Hezekiah M. C. <hez...@us...> - 2010-06-18 18:56:06
|
On Fri, Jun 18, 2010 at 2:11 PM, <si...@mu...> wrote: >>> I've searched around but haven't found a >>> clear example, although I think its something to do with mapping 'world >>> views' and 'pltr1/pltr2'. >> >> Our standard example 16 (e.g., examples/python/xw16.py) implements a polar >> plot in its last page for all our supported languages. See >> http://plplot.sourceforge.net/examples.php?demo=16 for further details. >> > > Unfortunately the examples aren't very clear (to me anyhow) and appear to > 'pre-process' the data before plotting it, which isn't really making use > of the pltr2 stuff. > > Digging around in the source (always the best documentation, eh) I found > this defination > -- > plimagefr( img, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, > [pltr, [pltr_data] or [xg, yg, [wrap]]]) > -- > > which lead me to write a sub-routine to manipulate the XY co-ordinates, > which I then call directly in 'plimagefr'. Working example attached. > > > When I attempted to apply the same approach to 'plstransform' I find it > does not work, as the parameter format is different. Why wouldn't these > behave exactly the same? (perhaps a Python binding bug). > These two functions working differently due to a slight difference in their intent. The pltr* functions take index values and translate them in to plot-world coordinates (ex. (i, j) indexing an element in a grid -> (x, y) position in plot space). plstransform takes a coordinate (ex. a radius and an angle for polar data) and translates this in to plot world (x, y) coordinates. The mapform function callback used in plmap or plmeridians works similarly (see example 19). These two (pltr* functions and plstranform) can be used together for more complicated coordinate transformation purposes. plstransform is a new addition to PLplot. Suggestions for improvements to its documentation [1] are quite welcome, particularly if its use and purpose are unclear. Hope this helps, Hez [1] - http://plplot.sourceforge.net/docbook-manual/plplot-html-5.9.6/plstransform.html |