Login  Register

Re: ij.gui.Plot enhancement request...

Posted by jmutterer on Nov 13, 2008; 7:14am
URL: http://imagej.273.s1.nabble.com/ij-gui-Plot-enhancement-request-tp3694518p3694519.html

Unintuitively, the last serie added to a plot is drawn first. Add the line
reference after your data points, and the list button will list your points.

Jerome.

Plot.add("dots", x, y);
Plot.add("line", newArray(0,x.length),newArray(0,y.length));

On Thu, Nov 13, 2008 at 7:32 AM, Jeffrey B. Woodward <
[hidden email]> wrote:

> ImageJ'ers/Wayne,
>
> I am trying to use the ij.gui.Plot class to create a scatter plot.
> Actually, the Plot contains both a scatter plot and a simple curve (diagonal
> line with points at [0,0] and [max,max]). The diagonal line is just for a
> visual reference; the real data points are what make up the scatter plot.
> The issue is that in doing this, I can't find a way for the user to use the
> List button (or the Save button) to get a listing of the data points. This
> is because the List/Save buttons seem only appear to operate on the points
> used in the constructor (in my case the endpoints of the reference
> diagonal), but my data points for the scatter plot are added after
> construction using the addPoints() method.
>
> My first thought was to supply my scatter plot points in the constructor
> and add the reference line with the addPoints() method; however, I don't see
> any way to avoid drawing them as a polyline doing it this way -- I want a
> scatter plot of those points, not a polyline!
>
> Hopefully I am missing something obvious in the API/source code, but in
> case if I am not, is this an enhancement that the ImageJ community is
> interested in? Should I take a crack at this myself, or is somebody else
> interested enough to do it?
>
> BTW: I suppose that there may be a hack/workaround for my specific
> case...perhaps I could supply my points in the constructor drawn with a
> fully transparent color/invisible-ink, then add the points for my reference
> diagonal using the addPoints() method with a LINE shape and appropriate
> color, and lastly, add the scatter plot points [again] with the addPoints()
> method with a DOT shape and appropriate color. Seems ugly -- probably doomed
> to failure -- other suggestions/hacks/workarounds/free-therapy-sessions are
> welcome.
>
> Many thanks,
>
> -Woody
>