## plplot-devel

 [Plplot-devel] plshade question From: David MacMahon - 2010-02-18 05:07:05 ```plshade has three "groups" of parameters that I am having a hard time understanding: 1) xmin,xmax,ymin,ymax - "Define the 'grid' coordinates. The data a [0][0] has a position of (xmin,ymin), a[nx-1][0] has a position at (xmax,ymin) and so on." 2) defined - "User function specifying regions excluded from the shading plot. This function accepts x and y coordinates as input arguments and must return 0 if the point is in the excluded region or 1 otherwise. This argument can be NULL if all the values are valid." 3) pltr, pltr_data parameters which translate 2D data indices into world coordinates. I think I understand pltr,pltr_data since those are also used in the plcont functions, but I have questions about the other two groups. What is the purpose of explicitly specifying xmin,xmax,ymin,ymax? Based on the comments/documentation, it sounds like xmin,ymin could be determined by passing (0,0) to pltr and xmax,ymax could be determined by passing (nx-1,ny-1). At least that's the case for pltr0 and pltr1 (with monotonic x and y grid axes), but for pltr2 the mapping from 2D data indices to world coordinates seems arbitrary (e.g. polar to rectangular) so determining xmin etc from pltr is not really viable. While that sounds like a valid reason for specifying xmin etc explicitly, the code for plshade looks like it uses (xmax- xmin)/nx to determine "dx" (and likewise for "dy"), which seems to assume a linear mapping from i and j indices to x and y world coordinates, so I'm back to being confused. Since "defined" does not have a corresponding "user data" pointer, it seems that whether a point is "defined" or not must be determinable solely from the x,y coordinates themselves and not from the 2D data values (or accompanying "data valid" flags array). Is the primary intent of this to limit the region that is shaded (kind if like kx,lx,ky,ly for plcont, but in world coordinates rather than 2D data indices)? FWIW, these questions arose because I'm trying to figure out the best way to deal with these parameters in my Ruby bindings. Thanks, Dave ```
 Re: [Plplot-devel] plshade question From: Alan W. Irwin - 2010-02-18 17:15:02 ```On 2010-02-17 21:06-0800 David MacMahon wrote: Hi Dave: I left out your other questions because I am confused on those issues as well. However, assuming you get them figured out, I would appreciate it if you took some additional time to update the relevant docbook documentation to help relieve everybody's confusion on these matters. > Since "defined" does not have a corresponding "user data" pointer, it > seems that whether a point is "defined" or not must be determinable > solely from the x,y coordinates themselves and not from the 2D data > values (or accompanying "data valid" flags array). Is the primary > intent of this to limit the region that is shaded (kind if like > kx,lx,ky,ly for plcont, but in world coordinates rather than 2D data > indices)? I can help you out a bit with this one. There is an example of how "defined" is used in the C version of example 16. And, FWIW, I think we should have adopted a more general API for "defined". However, I guess nobody cares too much about it because of its limitations. For example, the "defined" part of example 16 looks pretty good at normal resolution, but you get a real mess at lower resolutions. Thus, I don't think there is any language interface that currently propagates what C does with "defined", and I suggest you skip it for Ruby as well. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ```
 Re: [Plplot-devel] plshade question From: David MacMahon - 2010-02-18 17:57:30 ```On Feb 18, 2010, at 9:14 , Alan W. Irwin wrote: > I left out your other questions because I am confused on those > issues as > well. However, assuming you get them figured out, I would > appreciate it if > you took some additional time to update the relevant docbook > documentation > to help relieve everybody's confusion on these matters. I'll take a crack at it if/when I get to an appropriate level of understanding. > I can help you out a bit with this one. There is an example of how > "defined" is used in the C version of example 16. And, FWIW, I > think we > should have adopted a more general API for "defined". However, I > guess > nobody cares too much about it because of its limitations. For > example, the > "defined" part of example 16 looks pretty good at normal > resolution, but you > get a real mess at lower resolutions. Thanks for the pointer. Just to make this more searchable in the archives, use of plshade's "defined" feature is only demonstrated when giving x16c the "-exclude" option. Compare the output of these two commands... x16c -dev xwin -exclude x16c -dev xwin -exclude -nx 10 -ny 10 > Thus, I don't think there is any > language interface that currently propagates what C does with > "defined", Actually, the ocaml bindings seem to support this concept. > and > I suggest you skip it for Ruby as well. Too late! :-) I've already borrowed from the approach taken in the ocaml bindings. Dave ```
 Re: [Plplot-devel] plshade question From: Jerry - 2010-02-23 06:53:41 ```On Feb 18, 2010, at 10:14 AM, Alan W. Irwin wrote: > On 2010-02-17 21:06-0800 David MacMahon wrote: > > Hi Dave: > > I left out your other questions because I am confused on those > issues as > well. However, assuming you get them figured out, I would > appreciate it if > you took some additional time to update the relevant docbook > documentation > to help relieve everybody's confusion on these matters. > >> Since "defined" does not have a corresponding "user data" pointer, it >> seems that whether a point is "defined" or not must be determinable >> solely from the x,y coordinates themselves and not from the 2D data >> values (or accompanying "data valid" flags array). Is the primary >> intent of this to limit the region that is shaded (kind if like >> kx,lx,ky,ly for plcont, but in world coordinates rather than 2D data >> indices)? > > I can help you out a bit with this one. There is an example of how > "defined" is used in the C version of example 16. And, FWIW, I > think we > should have adopted a more general API for "defined". However, I > guess > nobody cares too much about it because of its limitations. For > example, the > "defined" part of example 16 looks pretty good at normal resolution, > but you > get a real mess at lower resolutions. Thus, I don't think there is > any > language interface that currently propagates what C does with > "defined", and > I suggest you skip it for Ruby as well. FWIW, the Ada bindings handle this and it is now working in Ada examples 16 after I repaired some errors in what was formerly commented-out code. But the Ada examples don't bother to parse the - exclude option so it is turned on and off by setting a boolean in the code. Jerry > > Alan ```

JavaScript is required for this form.

No, thanks