Login  Register

Re: Ignoring points in a plot

Posted by Rasband, Wayne (NIH/NIMH) [E] on Nov 08, 2015; 12:39am
URL: http://imagej.273.s1.nabble.com/Ignoring-points-in-a-plot-tp5014883p5014888.html

> On Nov 7, 2015, at 11:58 AM, Michael Schmid <[hidden email]> wrote:
>
> Hi Mona,
>
> if you plot a line where a point is NaN, it should break the line.
> But I see, there is bug (caused by me); the line from the previous point
> goes to the lower border of the image.
>
> I'll send a mail to Wayne to fix it.

Michael’s fix is in the latest ImageJ daily build (1.50e15).

> Here is a sample macro:
>
> x = newArray( 1, 3, 4, 5, 6, 7, 8, 9, 11 );
> y = newArray( 18, NaN, 3, 1, 7, 11, 11, 5, 2 );
>
> Plot.create("Example Plot", "x", "y", x, y);
>
> (For the macro, update ImageJ to the daily build; there is a problem with
> NaN in macros in some recent ImageJ versions)

The problem with NaNs was only with macro code used by the Process>Math>Macro command.

-wayne

> __________________________________________________________________
>
> On Sat, November 7, 2015 05:21, mona_c wrote:
>> Is it possible to ignore certain points when plotting a line plot? The
>> following code is from plot example in Fiji. The bold line is changed,
>> however it does not work i get: expected double[] y2 = { 18, Double.[], 3,
>> 1, 7, 11, 11, 5, 2 };
>> Changing it to Double.NaN also doesn't work correctly, since it goes to
>> -inf.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html