The plot window is already open, and may contain more than one graph.
I’ve managed to get the active PlotWindow and test if it’s really what it should be. Now I would like to get the values of all the graphs, but I cannot figure out how to do that.
PlotWindow.GetPlot() always returns data from a single graph.
Here’s the skeleton of the code:
import ij.* import ij.IJ import ij.WindowManager // Some plot window should be selected before running window = WindowManager.getCurrentWindow() if(!(window instanceof ij.gui.PlotWindow)) throw new IllegalArgumentException(window.getTitle() + " is not a plot window.") plot = window.getPlot() (xValues, yValues) = [plot.getXValues(), plot.getYValues()] IJ.log("" + yValues)
The last line is just for checking which plot has been selected and each time, it is the “first” one, i.e. the plot that was already present in the window before another one was added.
Any idea someone? Maybe I have to iterate over the elements of the plot window?
Thank you for your help!