Hi Fred,

yes, it's a bug, I'll try to fix it.

Michael
________________________________________________________________
On 28.01.24 23:17, Fred Damen 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.

Fred


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

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

Reply via email to