Bug in the "List..." command of plot windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in the "List..." command of plot windows

Tiago Ferreira-2
Dear Wayne (and others):

Just noticed that since IJ 1.48, the "List..." button in PlotWindows reports and
empty table unless data series are drawn as "lines" or "dots". Here is a .bsh
example:

double[] x1 = {1, 2, 3, 4, 5};
double[] y1 = {5, 4, 3, 2, 1};
double[] x2 = {5, 6, 7, 8, 9};
double[] y2 = {9, 8, 7, 6, 5};

plot = new Plot("Pressing List... Fails", "x", "y");
plot.setLimits(0,10,0,10);
plot.addPoints(x1, y1, Plot.CROSS);
plot.addPoints(x2, y2, Plot.CIRCLE);
plot.show();

plot = new Plot("Pressing List... Works", "x", "y");
plot.setLimits(0,10,0,10);
plot.addPoints(x1, y1, Plot.LINE);
plot.addPoints(x2, y2, Plot.LINE);
plot.show();

I'm guessing this behavior was introduced in IJ 1.48m14:
<https://github.com/imagej/imagej1/blame/master/ij/gui/Plot.java#L367>

(Release notes: Fixed a bug that caused the "List" option in plot windows to
 sometimes display duplicate arrays.)

However, current behavior is actually quite disappointing as we loose access to
the data when multiple series get plotted. I could bypass this by using
different colors, but often different shapes allow easier distinction of
datasets...

Would it be possible to revert to the old behavior?
What caused the listing of duplicate arrays? Perhaps there is another workaround?

-tiago

PS: While at it, it seems that Y_FORCE2GRID is never used, rather X_FORCE2GRID
    is used twice:
    <https://github.com/imagej/imagej1/blob/master/ij/gui/Plot.java#L765>
        if ((flags&X_FORCE2GRID)!=0)
    <https://github.com/imagej/imagej1/blob/master/ij/gui/Plot.java#L838>
        if ((flags&X_FORCE2GRID)!=0) >>Should be>> if ((flags&Y_FORCE2GRID)!=0

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Bug in the "List..." command of plot windows

CARL Philippe (LBP)
Dear Tiago,
I'm responsible for error at the Y_FORCE2GRID.
Thanks a lot for reporting this mistake.
My best regards,
Philippe

Le Mardi 10 Juin 2014 19:32 CEST, Tiago Ferreira <[hidden email]> a écrit:

> Dear Wayne (and others):
>
> Just noticed that since IJ 1.48, the "List..." button in PlotWindows reports and
> empty table unless data series are drawn as "lines" or "dots". Here is a .bsh
> example:
>
> double[] x1 = {1, 2, 3, 4, 5};
> double[] y1 = {5, 4, 3, 2, 1};
> double[] x2 = {5, 6, 7, 8, 9};
> double[] y2 = {9, 8, 7, 6, 5};
>
> plot = new Plot("Pressing List... Fails", "x", "y");
> plot.setLimits(0,10,0,10);
> plot.addPoints(x1, y1, Plot.CROSS);
> plot.addPoints(x2, y2, Plot.CIRCLE);
> plot.show();
>
> plot = new Plot("Pressing List... Works", "x", "y");
> plot.setLimits(0,10,0,10);
> plot.addPoints(x1, y1, Plot.LINE);
> plot.addPoints(x2, y2, Plot.LINE);
> plot.show();
>
> I'm guessing this behavior was introduced in IJ 1.48m14:
> <https://github.com/imagej/imagej1/blame/master/ij/gui/Plot.java#L367>
>
> (Release notes: Fixed a bug that caused the "List" option in plot windows to
>  sometimes display duplicate arrays.)
>
> However, current behavior is actually quite disappointing as we loose access to
> the data when multiple series get plotted. I could bypass this by using
> different colors, but often different shapes allow easier distinction of
> datasets...
>
> Would it be possible to revert to the old behavior?
> What caused the listing of duplicate arrays? Perhaps there is another workaround?
>
> -tiago
>
> PS: While at it, it seems that Y_FORCE2GRID is never used, rather X_FORCE2GRID
>     is used twice:
>     <https://github.com/imagej/imagej1/blob/master/ij/gui/Plot.java#L765>
>         if ((flags&X_FORCE2GRID)!=0)
>     <https://github.com/imagej/imagej1/blob/master/ij/gui/Plot.java#L838>
>         if ((flags&X_FORCE2GRID)!=0) >>Should be>> if ((flags&Y_FORCE2GRID)!=0
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Bug in the "List..." command of plot windows

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Tiago Ferreira-2
On Jun 10, 2014, at 1:32 PM, Tiago Ferreira wrote:

> Dear Wayne (and others):
>
> Just noticed that since IJ 1.48, the "List..." button in PlotWindows reports and
> empty table unless data series are drawn as "lines" or "dots". Here is a .bsh
> example:

This regression is fixed in the latest ImageJ daily build (1.49c11).

> double[] x1 = {1, 2, 3, 4, 5};
> double[] y1 = {5, 4, 3, 2, 1};
> double[] x2 = {5, 6, 7, 8, 9};
> double[] y2 = {9, 8, 7, 6, 5};
>
> plot = new Plot("Pressing List... Fails", "x", "y");
> plot.setLimits(0,10,0,10);
> plot.addPoints(x1, y1, Plot.CROSS);
> plot.addPoints(x2, y2, Plot.CIRCLE);
> plot.show();
>
> plot = new Plot("Pressing List... Works", "x", "y");
> plot.setLimits(0,10,0,10);
> plot.addPoints(x1, y1, Plot.LINE);
> plot.addPoints(x2, y2, Plot.LINE);
> plot.show();
>
> I'm guessing this behavior was introduced in IJ 1.48m14:
> <https://github.com/imagej/imagej1/blame/master/ij/gui/Plot.java#L367>
>
> (Release notes: Fixed a bug that caused the "List" option in plot windows to
> sometimes display duplicate arrays.)
>
> However, current behavior is actually quite disappointing as we loose access to
> the data when multiple series get plotted. I could bypass this by using
> different colors, but often different shapes allow easier distinction of
> datasets...
>
> Would it be possible to revert to the old behavior?
> What caused the listing of duplicate arrays? Perhaps there is another workaround?

You would get duplicate arrays with line plots that had each point marked with a shape such as a circle. The daily build has a better way of detecting duplicate arrays.

> -tiago
>
> PS: While at it, it seems that Y_FORCE2GRID is never used, rather X_FORCE2GRID
>    is used twice:
>    <https://github.com/imagej/imagej1/blob/master/ij/gui/Plot.java#L765>
>        if ((flags&X_FORCE2GRID)!=0)
>    <https://github.com/imagej/imagej1/blob/master/ij/gui/Plot.java#L838>
>        if ((flags&X_FORCE2GRID)!=0) >>Should be>> if ((flags&Y_FORCE2GRID)!=0

This bug is also fixed in the daily build.

-wayne
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Bug in the "List..." command of plot windows

Tiago Ferreira-2
On Jun 11, 2014, at 04:03, Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote:
> You would get duplicate arrays with line plots that had each point marked with a shape such as a circle.
> The daily build has a better way of detecting duplicate arrays.

Thanks!
Seems to work much better indeed.


On Jun 10, 2014, at 15:06, CARL Philippe (PHA) <[hidden email]> wrote:
> I'm responsible for error at the Y_FORCE2GRID. Thanks a lot for reporting this mistake.

No, thank you for implementing the log and arrow plots. They are great! Well worth any minor issue such as this one.


-tiago

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