diff --git a/pub/lib/plot.cpp b/pub/lib/plot.cpp index e49fa21970268a8a68860dc27a6333f3f0d02f16..a6bd6d2706ffa7e1cb1dee046b5dc239e652f982 100644 --- a/pub/lib/plot.cpp +++ b/pub/lib/plot.cpp @@ -538,8 +538,7 @@ namespace { plot->Z.set_limits(zlim.front(), zlim.back()); plot->Y.set_limits(yinf, ysup); // plot - plot->start_frame2D( - "Frida version " VERSION, fd->xco.str_ps(), fd->ZCo[0].str_ps(), fd->yco.str_ps()); + plot->start_frame2D("Frida version " VERSION); for (size_t j=0; j<m; ++j) { const CSpec* s = fd->VS(j); vector<double> xlim = triv::histogram_limits(s->x); @@ -549,6 +548,7 @@ namespace { % xlim[i] % xlim[i+1] % zlim[j] % zlim[j+1] % s->y[i] ) ); plot->ps_line(""); } + plot->close_frame2D(fd->xco.str_ps(), fd->ZCo[0].str_ps(), fd->yco.str_ps()); // doclines plot->doc_TxLine(fd->name); for (int i = 0; i < fd->lDoc.size(); i++) diff --git a/pub/plot/dualplot.cpp b/pub/plot/dualplot.cpp index 5a2065903175d5d6a6919fd41c201691f0eba850..dc9b98895bec638e9526cdfbe6764e8301867955 100644 --- a/pub/plot/dualplot.cpp +++ b/pub/plot/dualplot.cpp @@ -108,12 +108,19 @@ void CPlot::start_frame1D(const string& caller, const string& xlabel, const stri } -//! Clear 2D plot canvas, and plot coordinate frame (axes, ticks, labels). +//! Clear 2D plot canvas, and print coordinate ranges -void CPlot::start_frame2D( - const string& caller, const string& xlabel, const string& zlabel, const string& ylabel) +void CPlot::start_frame2D(const string& caller) { - ps_Plotter->start_frame2D(caller, X, Z, Y, xlabel, zlabel, ylabel); + ps_Plotter->start_frame2D(caller, X, Z, Y); +} + + +//! Plot coordinate frame (axes, ticks, labels). + +void CPlot::close_frame2D(const string& xlabel, const string& zlabel, const string& ylabel) +{ + ps_Plotter->close_frame2D(X, Z, Y, xlabel, zlabel, ylabel); } diff --git a/pub/plot/dualplot.hpp b/pub/plot/dualplot.hpp index 9e0a0adf70acf033fabacc28b19d0755bc4f8d04..e2bb3d6a1911c01eb17564b473ed89985c1f5c11 100644 --- a/pub/plot/dualplot.hpp +++ b/pub/plot/dualplot.hpp @@ -36,9 +36,9 @@ public: void gp_write(const std::string& in); void start_frame1D( const std::string& caller, const std::string& xlabel, const std::string& ylabel); - void start_frame2D( - const std::string& caller, const std::string& xlabel, const std::string& zlabel, - const std::string& ylabel); + void start_frame2D(const std::string& caller); + void close_frame2D( + const std::string& xlabel, const std::string& zlabel, const std::string& ylabel); void add_spec( bool as_line, bool new_slice, int style_no, const std::vector<double>& xp, const std::vector<double>& yp, const std::vector<double>& dyp, diff --git a/pub/plot/ps_plotter.cpp b/pub/plot/ps_plotter.cpp index 858872a23035c6e3ad65c12ed2171b4986e73565..eb2acfcf957662470adeb87ab45cf36a19ddb4ca 100644 --- a/pub/plot/ps_plotter.cpp +++ b/pub/plot/ps_plotter.cpp @@ -57,8 +57,7 @@ void CPS_Plotter::start_frame1D( } void CPS_Plotter::start_frame2D( - const std::string& caller, const CAxis& _X, const CAxis& _Z, const CAxis& _Y, - const std::string& xlabel, const std::string& zlabel, const std::string& ylabel) + const std::string& caller, const CAxis& _X, const CAxis& _Z, const CAxis& _Y) { p2D = true; X = &_X; @@ -70,6 +69,16 @@ void CPS_Plotter::start_frame2D( ps_accu += ps_coord(X, 'x'); ps_accu += ps_coord(Z, 'y'); ps_accu += ps_coord(Y, 'h'); + ps_accu += "\n"; +} + +void CPS_Plotter::close_frame2D( + const CAxis& _X, const CAxis& _Z, const CAxis& _Y, + const std::string& xlabel, const std::string& zlabel, const std::string& ylabel) +{ + ps_accu += "/linsetTic {white 1 setline} def\n"; + ps_accu += "/linsetTac {white 1.3 setline} def\n\n"; + ps_accu += ps_axis(X, xlabel, 'x') + ps_horiz(); ps_accu += ps_axis(Z, zlabel, 'y') + ps_verti(); ps_accu += ps_axis(Y, ylabel, 'h') + ps_colorscale(); diff --git a/pub/plot/ps_plotter.hpp b/pub/plot/ps_plotter.hpp index 600f4dddb03d10fa570dd946bd972cc8a88f4340..82bbeea79ee8171819f8aa67f1f0e600fae359d9 100644 --- a/pub/plot/ps_plotter.hpp +++ b/pub/plot/ps_plotter.hpp @@ -21,7 +21,9 @@ public: const std::string& caller, const CAxis& _X, const CAxis& _Y, const std::string& xlabel, const std::string& ylabel); void start_frame2D( - const std::string& caller, const CAxis& _X, const CAxis& _Z, const CAxis& _Y, + const std::string& caller, const CAxis& _X, const CAxis& _Z, const CAxis& _Y); + void close_frame2D( + const CAxis& _X, const CAxis& _Z, const CAxis& _Y, const std::string& xlabel, const std::string& zlabel, const std::string& ylabel); void add_spec( bool as_line, bool new_slice, int style_no, diff --git a/pub/share/wups17a.ps b/pub/share/wups17a.ps index e7f0c210da01a649d49abe3c8e8b615896ebd522..d7f526d3370209232b59b82b425640c9bbf4904b 100644 --- a/pub/share/wups17a.ps +++ b/pub/share/wups17a.ps @@ -386,8 +386,9 @@ WuGdict17a begin } def % standard settings for labelling axes -/setnum { /MyFont 24 setfontandsize } def -/setlab { /MyFont 24 setfontandsize } def +/numlabcol { black } def +/setnum { /MyFont 24 setfontandsize numlabcol } def +/setlab { /MyFont 24 setfontandsize numlabcol } def % user commands (free choice of fontsize, but fixed font family) /setown { /MyFont x setfontandsize } def