> On Jan 28, 2024, at 5:17 PM, Fred Damen <[email protected]> wrote:
>
> Greetings,
>
> I have a plot with many curves, and for some reason one of these curves
> contains infinity. To investigate why, I would like to look at the other
> curves in this plot, so through the GUI options I try and change the
> y-range to only encompass the valid data, albeit the Y-range does not
> change. I even tried to disable visibility of the curve with the infinite
> values and set the range again; nope.
Thanks to Michael Schmid, this bug is fixed in the latest ImageJ daily build
(1.54i10). The Plot class now ignores infinite values when calculating the
limits. And, when drawing lines, it shows the presence of infinite values by
drawing a line towards the border of the plot frame.
-wayne
> import ij.*;
> import ij.process.*;
> import ij.gui.*;
> import java.awt.*;
> import java.awt.event.*;
> import ij.plugin.*;
> import ij.plugin.frame.*;
>
> public class TestuseTemplate implements PlugIn {
>
> PlotWindow pwin = null;
> Plot prevPlot = null;
> public void run(String arg) {
> GenericDialog gd = new NonBlockingGenericDialog("test useTemplate");
> gd.addButton("Press me",new ActionListener() {
> public void actionPerformed(ActionEvent e) {
> Plot plot = new Plot("Title", "X", "Y");
> plot.addPoints(new float[]{0,10,100,1000},new
> float[]{0,10,100,1000},Plot.LINE);
> plot.setLabel(-1,"definite");
> plot.addPoints(new float[]{0,10,100,1000},new
> float[]{Float.POSITIVE_INFINITY,Float.POSITIVE_INFINITY,Float.POSITIVE_INFINITY,Float.POSITIVE_INFINITY},Plot.LINE);
> plot.setLabel(-1,"infinite");
>
> plot.setLimitsToFit(true);
>
> if (prevPlot != null)
> plot.useTemplate(prevPlot,
> Plot.COPY_SIZE+Plot.X_RANGE+Plot.COPY_AXIS_STYLE);
>
> if (pwin==null)
> pwin = plot.show();
> else
> pwin.drawPlot(plot);
>
> prevPlot = plot;
> }
> });
> gd.showDialog();
> }
>
> }
>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html