On 2007-09-17 20:24-0400 Charles Parker wrote:

> Hello plplot community :^)

Welcome to the list.

>
> I have two questions w/ regards to the functionality of the plplot C++
> bindings.
>
> First, is it possible to plot single pixels in scatter plot (plpoin)? I've
> tried using a lot of the different symbols and changing the size of those
> symbols (with plssym), but I can't seem to find a combination that will just
> turn on a single pixel for each data point I plot.

I have discovered recently that some devices (e.g., the pscairo device that
is part of the new cairo device driver family) honor font hinting.  One
characteristic of font hinting is it aligns characters with the pixel grid.
I don't know what happens for small characters, but I assume you would get
an equal hit on 4 pixels or a hit on one pixel.  Anyhow, try pscairo (from
latest svn) and see whether it helps.  When viewing the results you will
have to turn off antialiasing in your PostScript viewer to see exactly
which pixels have been painted.

For devices that don't honor font hinting, world coordinates are not going
to be aligned with pixel coordinates so more than one pixel will be involved
when painting a dot at arbitrary x, y.  However, from the known pixel range
of your device, you should be able to do your own pixel alignment by
carefully choosing plvpor values and world coordinates so the latter match
integer pixel values.  Then it is only a matter of taking the nearest
integral value for the x and y positions to get consistent alignment on
pixels.  Under those circumstances, your tiny characters should always at
least look the same, and may even correspond to painting a single pixel for
the no antialiasing case.

>
> Second, I'm going to be plotting about 5000 data points or so, the problem
> is that the way my data are structured, the points I need to plot are not
> stored sequentially in memory. I have data with about 15 parameters per
> point, and I only want to plot points (the x and y are two of the
> parameters) that satisfy some filtering criteria. Am I better off simply
> taking the memory and performance hit to create an additional data structure
> in which these data are sequential? Or can I simply call plpoin to plot each
> individual point? In the latter case I would loop through the data only once
> and plot points as I found them, whereas in the former there is the extra
> overhead of creating the data structure and copying the data before I can
> plot it.

I think the speed for unordered access will depend on the size of your cache
and the degree of non-locality of reference.  Taking data out of order may
actually make little difference at all.  Regardless of that, I always
try as a general rule to use the simplest programming to prototype what I
want and optimize further (with the associated increased danger of
introducing bugs) only if really necessary.  Anyhow, that is what I suggest
in the present case.

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
__________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to