From a4d04ebeceae849dedf018efa5d8c76d5711150e Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 1 May 2018 10:51:46 +0200 Subject: [PATCH] add marker line for 60s threshold In logarithmic plots it is not easy to spot which event are longer than 60 seconds. A thin grey line help with this. Also: fixed the marker lines (zoom area) which broke when y-ranges were introduced. The lines were not drawn correctly, when the y-axis offset was greater than 0. Gnuplot supports differen coordinate systems. 'graph' is relative to the area within the axes, 0,0 is bottom left and 1,1 is top right. And 'first' is based on the values of the x1 axis. By using "graph 0.25,0" we say that the starting point is 25% of the x-axis and 0% of the y-axis without having to compute the exact values. --- .../lucares/recommind/logs/GnuplotFileGenerator.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 56b16c1..0e8f5b1 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 @@ -53,12 +53,11 @@ public class GnuplotFileGenerator { appendfln(result, "set output \"%s\"", settings.getOutput().toAbsolutePath().toString().replace("\\", "/")); // marker lines that show which area will be zoomed - final long minDate = Long.parseLong(settings.getxAxisSettings().getFrom()); - final long maxDate = Long.parseLong(settings.getxAxisSettings().getTo()); - appendfln(result, "set arrow from " + (minDate + (maxDate - minDate) * 0.25) + "," + graphOffset - + " rto graph 0,1 lt 3 lc rgb \"#EEEEEE\" nohead"); - appendfln(result, "set arrow from " + (minDate + (maxDate - minDate) * 0.75) + "," + graphOffset - + " rto graph 0,1 lc rgb \"#EEEEEE\" nohead"); + appendfln(result, "set arrow from graph 0.25,0 rto graph 0,1 lc rgb \"#EEEEEE\" nohead"); + appendfln(result, "set arrow from graph 0.75,0 rto graph 0,1 lc rgb \"#EEEEEE\" nohead"); + + // marker line for the 60 second threshold + appendfln(result, "set arrow from graph 0, first 60000 rto graph 1,0 lc rgb \"#EEEEEE\" nohead"); if (settings.isKeyOutside()) { appendfln(result, "set key outside");