From d86158a94ae0c22b9730ebbaa37cea3606d04b6c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Oct 2017 23:04:39 +0200 Subject: [PATCH] Adjust font size in pdf files --- src/tests/common-files/gnuplot_i.h | 6 +++--- src/tests/system-tests/position_test.cc | 2 +- src/tests/unit-tests/arithmetic/fft_length_test.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 25ae7b681..614dc678e 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -247,7 +247,7 @@ public: Gnuplot& savetops(const std::string &filename = "gnuplot_output"); /// saves a gnuplot session to a pdf file, filename without extension - Gnuplot& savetopdf(const std::string &filename = "gnuplot_output"); + Gnuplot& savetopdf(const std::string &filename = "gnuplot_output", unsigned int font_size = 12); //---------------------------------------------------------------------------------- // set and unset @@ -1070,10 +1070,10 @@ Gnuplot& Gnuplot::showonscreen() // // saves a gnuplot session to a pdf file // -Gnuplot& Gnuplot::savetopdf(const std::string &filename) +Gnuplot& Gnuplot::savetopdf(const std::string &filename, unsigned int font_size) { std::ostringstream cmdstr; - cmdstr << "set term pdfcairo enhanced color font \"Times-New-Roman,18\"\n"; + cmdstr << "set term pdfcairo enhanced color font \"Times-New-Roman," + std::to_string(font_size) + "\"\n"; cmdstr << "set output \"" << filename << ".pdf\"\n"; cmdstr << "replot"; cmd(cmdstr.str()); diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index c1705eca1..048abefea 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -617,7 +617,7 @@ void StaticPositionSystemTest::print_results(const std::vector & east, g1.cmd("replot"); g1.savetops("Position_test_2D"); - g1.savetopdf("Position_test_2D"); + g1.savetopdf("Position_test_2D", 18); g1.showonscreen(); // window output Gnuplot g2("points"); diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index 0448fc114..f8ea83d22 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -126,7 +126,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) g1.plot_xy(fft_sizes_v, execution_times, "FFT execution time (averaged over " + std::to_string(FLAGS_fft_iterations_test) + " iterations)"); g1.set_style("points").plot_xy(powers_of_two, execution_times_powers_of_two, "Power of 2"); g1.savetops("FFT_execution_times_extended"); - g1.savetopdf("FFT_execution_times_extended"); + g1.savetopdf("FFT_execution_times_extended", 18); g1.showonscreen(); // window output Gnuplot g2("linespoints"); @@ -138,7 +138,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) g2.plot_xy(fft_sizes_v, execution_times, "FFT execution time (averaged over " + std::to_string(FLAGS_fft_iterations_test) + " iterations)"); g2.set_style("points").plot_xy(powers_of_two, execution_times_powers_of_two, "Power of 2"); g2.savetops("FFT_execution_times"); - g2.savetopdf("FFT_execution_times"); + g2.savetopdf("FFT_execution_times", 18); g2.showonscreen(); // window output } catch (GnuplotException ge)