29 lines
741 B
Java
29 lines
741 B
Java
package ch.psi.plot.plot.done;
|
|
|
|
import java.awt.Color;
|
|
|
|
import org.jfree.chart.annotations.XYAnnotation;
|
|
import org.jfree.chart.annotations.XYDrawableAnnotation;
|
|
|
|
import ch.psi.plot.util.XYPoint;
|
|
import ch.psi.plot.xy.LinePlot;
|
|
import ch.psi.plot.xyz.CrossDrawer;
|
|
|
|
public class Mins implements PlugableUtilXY{
|
|
|
|
@Override
|
|
public void execute(LinePlot lineplot) {
|
|
for (XYPoint min : Extrema.findExtrema(lineplot.getData(), true)){
|
|
CrossDrawer cd = new CrossDrawer(Color.BLACK);
|
|
XYAnnotation cross = new XYDrawableAnnotation(min.getX(), min.getY(), 10.0, 10.0, cd);
|
|
lineplot.getChartPanel().getChart().getXYPlot().addAnnotation(cross);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public String getLabel() {
|
|
return this.getClass().getSimpleName();
|
|
}
|
|
|
|
}
|