From f58764d81567e3af60388e9505ebaf54385649ee Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Thu, 6 Jul 2017 10:32:11 +0200
Subject: [PATCH] make consequential use of axis names. previous commits: use
 wx, wy, wh in setting ticks and tacks

---
 pub/plot/ps_plotter.cpp | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/pub/plot/ps_plotter.cpp b/pub/plot/ps_plotter.cpp
index d2537f3a..7838b119 100644
--- a/pub/plot/ps_plotter.cpp
+++ b/pub/plot/ps_plotter.cpp
@@ -25,8 +25,8 @@ using boost::format;
 namespace {
     string ps_ticktack(
         const vector<double>& Tacks, const int ntpt, const double* ticklim, const CAxis* A);
-    string ps_coord(const CAxis* A, const char a);
-    string ps_axis(const CAxis* A, const char a);
+    string ps_coord(const CAxis* A);
+    string ps_axis(const CAxis* A);
     string ps_horiz(const string& label);
     string ps_verti(const string& label);
     string ps_colorscale(const string& label);
@@ -50,11 +50,11 @@ void CPS_Plotter::start_frame1D(
     ps_snum = 0;
     ps_Doc = "";
     ps_accu = "\n%% output created by " + caller + "\n\n";
-    ps_accu += ps_coord(X, 'x');
-    ps_accu += ps_coord(Y, 'y');
+    ps_accu += ps_coord(X);
+    ps_accu += ps_coord(Y);
     ps_accu += "\n";
-    ps_accu += ps_axis(X, 'x') + ps_horiz(xlabel);
-    ps_accu += ps_axis(Y, 'y') + ps_verti(ylabel);
+    ps_accu += ps_axis(X) + ps_horiz(xlabel);
+    ps_accu += ps_axis(Y) + ps_verti(ylabel);
     ps_accu += "\n";
 }
 
@@ -68,9 +68,9 @@ void CPS_Plotter::start_frame2D(
     ps_snum = 0;
     ps_Doc = "";
     ps_accu = "\n%% output created by " + caller + "\n\n";
-    ps_accu += ps_coord(X, 'x');
-    ps_accu += ps_coord(Z, 'y');
-    ps_accu += ps_coord(Y, 'h');
+    ps_accu += ps_coord(X);
+    ps_accu += ps_coord(Z);
+    ps_accu += ps_coord(Y);
     ps_accu += "\n";
 }
 
@@ -81,9 +81,9 @@ void CPS_Plotter::close_frame2D(
     ps_accu += "/linsetTic {white 1 setline} def\n";
     ps_accu += "/linsetTac {white 1.3 setline} def\n\n";
 
-    ps_accu += ps_axis(X, 'x') + ps_horiz(xlabel);
-    ps_accu += ps_axis(Z, 'y') + ps_verti(zlabel);
-    ps_accu += ps_axis(Y, 'h') + ps_colorscale(ylabel);
+    ps_accu += ps_axis(X) + ps_horiz(xlabel);
+    ps_accu += ps_axis(Z) + ps_verti(zlabel);
+    ps_accu += ps_axis(Y) + ps_colorscale(ylabel);
 }
 
 void CPS_Plotter::add_spec(
@@ -190,18 +190,19 @@ namespace {
         return ret;
     }
 
-    string ps_coord(const CAxis* A, const char a)
+    string ps_coord(const CAxis* A)
     {
-        return str(format("%1i %12.4g %12.4g %cSetCoord\n") % A->logflag % A->inf % A->sup % a);
+        return str(format("%1i %12.4g %12.4g %cSetCoord\n")
+                   % A->logflag % A->inf % A->sup % A->name);
     }
 
-    string ps_axis(const CAxis* A, const char a)
+    string ps_axis(const CAxis* A)
     {
         string ret;
         int ntpt;
         double ticklim[2];
         vector<double> Tacks;
-        ret += "% " + string(1,a) + " axis:\n";
+        ret += "% " + A->name + " axis:\n";
         if (A->logflag && A->inf <= 0)
             throw "BUG: log incompatible with limits " + A->str();
         A->calc_ticks(Tacks, &ntpt, ticklim);
-- 
GitLab