03-31-2010 06:15 AM
A question, may be a comment:
While PlotXY accepts various data formats, double, int, and ssize_t integers, the plotline command is limited to double. Hence, I can not use the same data set to plot a line if the data are ssize_t integers without getting compiler warnings 'Conversion from 'ssize_t' to 'double' might lose data'. Of course, the warning is correct, but why not permit plotting integers?
(Background: sometimes events are counted and evaluated (normalized, offset corrected...) Using integers preserves precision, while at large numbers double values loose significant digits. Now, plotting a line from a large data set may be useful to connect two points from the data set, indicating a baseline ...)
Any recommendations? If not, may I suggest to update the PlotLine... commands to accept 64 bit integers, too?
03-31-2010 01:26 PM
The plotting functions that accept arrays (PlotX, PlotY, PlotWaveform, etc...) can accept variable data parameters because they can simply declare those arrays as void *. But functions that take scalars (PlotPoint, PlotLine, etc...) cannot accept values of variable types in a single function. They could do it by forcing you to pass a pointer to the value, instead of the value, but that would also be more cumbersome since it would require you to always use a variable. You wouldn't be able to pass a constant instead.
The warning from ssize_t to double makes sense (in 64-bit), but you can easily suppress it by casting it to a double when you pass it to PlotLine.
Luis
04-01-2010 02:37 AM
Thanks, Luis.
May I then suggest to modify some analysis functions to accept both integers and doubles, e.g. Clear1D, LinEv1D etc.: now, for integer arrays, all these nice array functions cannot be used...
Wolfgang