diff --git a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java index e157bd9e0..86a7a880f 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java +++ b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java @@ -327,10 +327,13 @@ public class SimulationPlot extends Plot<FlightDataType, FlightDataBranch, Simul yName, ycoord, unitY, sampleIdx) ; double yloc = slope * ycoord + intercept; - XYImageAnnotation annotation = - new XYImageAnnotation(xcoord, yloc, image, RectangleAnchor.CENTER); - annotation.setToolTipText(tooltipText); - plot.addAnnotation(annotation); + + if (!Double.isNaN(xcoord) && !Double.isNaN(ycoord)) { + XYImageAnnotation annotation = + new XYImageAnnotation(xcoord, yloc, image, RectangleAnchor.CENTER); + annotation.setToolTipText(tooltipText); + plot.addAnnotation(annotation); + } } } }