diff --git a/pdb-plotting/src/main/java/org/lucares/recommind/logs/GnuplotFileGenerator.java b/pdb-plotting/src/main/java/org/lucares/recommind/logs/GnuplotFileGenerator.java index 50cf000..bb6bbd1 100644 --- a/pdb-plotting/src/main/java/org/lucares/recommind/logs/GnuplotFileGenerator.java +++ b/pdb-plotting/src/main/java/org/lucares/recommind/logs/GnuplotFileGenerator.java @@ -36,7 +36,12 @@ public class GnuplotFileGenerator { final int min = Math.max(settings.getYRangeMin(), graphOffset); final int max = settings.getYRangeMax(); appendfln(result, String.format("set yrange [\"%d\":\"%d\"]", min, max)); - } else { + } else if(dataSeries.isEmpty()) { + // If there is no data, then Gnuplot won't generate an image. + // Workaround is to explicitly specify the y-axis range. + // We choose a range for which no ticks are defined. This creates an empty y-axis. + appendfln(result, "set yrange [\"%d\":\"%d\"]", 0, -1); + }else { appendfln(result, "set yrange [\"" + graphOffset + "\":]"); }