fix image creation for automatic y-range
This commit is contained in:
@@ -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 + "\":]");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user