extract constants for gnuplot margins in px
This commit is contained in:
@@ -197,17 +197,12 @@ public class GnuplotFileGenerator {
|
||||
final StringBuilder result = new StringBuilder();
|
||||
appendfln(result, "set ylabel \"%s\"", "Duration");
|
||||
|
||||
final long plotHeight = height - 133; // sum of top/bottom margin, see marker (1)
|
||||
final long plotHeight = height - GnuplotSettings.GNUPLOT_TOP_BOTTOM_MARGIN; // sum of top/bottom margin, see
|
||||
// marker (1)
|
||||
final long maxLabels = plotHeight / (TICKS_FONT_SIZE * 5);
|
||||
System.out.println("labels: " + maxLabels);
|
||||
|
||||
final long range = yRangeMax - yRangeMin;
|
||||
final long msPerLabel = roundToLinearLabelSteps(range / maxLabels);
|
||||
final long digits = (long) Math.ceil(Math.log10(msPerLabel));
|
||||
|
||||
System.out.println("range: " + range);
|
||||
System.out.println("msPerLabel: " + msPerLabel);
|
||||
System.out.println("digits: " + digits);
|
||||
|
||||
final List<String> ticsLabels = new ArrayList<>();
|
||||
for (long i = yRangeMin; i <= yRangeMax; i += msPerLabel) {
|
||||
|
||||
@@ -6,6 +6,13 @@ import org.lucares.pdb.plot.api.AggregateHandler;
|
||||
import org.lucares.pdb.plot.api.AxisScale;
|
||||
|
||||
public class GnuplotSettings {
|
||||
|
||||
public final static int GNUPLOT_LEFT_MARGIN = 110; // The left margin configured for gnuplot
|
||||
public final static int GNUPLOT_RIGHT_MARGIN = 110; // The right margin configured for gnuplot
|
||||
public final static int GNUPLOT_TOP_MARGIN = 57; // The top margin configured for gnuplot
|
||||
public final static int GNUPLOT_BOTTOM_MARGIN = 76; // The bottom margin configured for gnuplot
|
||||
public final static int GNUPLOT_TOP_BOTTOM_MARGIN = GNUPLOT_TOP_MARGIN + GNUPLOT_BOTTOM_MARGIN;
|
||||
|
||||
private String terminal = "png";
|
||||
private int height = 1200;
|
||||
private int width = 1600;
|
||||
|
||||
Reference in New Issue
Block a user