Skip to content
Snippets Groups Projects
Commit 8b099039 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

corr names for 2D case

parent 4e546322
No related branches found
No related tags found
No related merge requests found
......@@ -24,18 +24,32 @@ using std::cout;
CPlot::CPlot(int _iPlot, bool _logx, bool _logy, bool _p2D, bool _logz)
: iPlot(_iPlot)
, p2D(_p2D)
, X("x", _logx)
, Y("y", _logy)
, Z("z", _logz)
, Z("UNUSED", _logz)
, maxpoints(20000)
, with_errors(true)
, equipoints(120)
, refine(true)
, gnuPlotter(new CGnuPlotter(iPlot))
, ps_Plotter(new CPS_Plotter)
{}
{
set_dims(_p2D);
}
//! Sets 1D or 2D; sets axis names accordingly.
void CPlot::set_dims(const bool _p2D)
{
p2D = _p2D;
if (p2D) {
Y.name = "h";
Z.name = "y";
} else {
Y.name = "y";
Z.name = "UNUSED";
}
}
//! Change one setup parameter per command.
......@@ -88,11 +102,11 @@ void CPlot::set_aux(const string& cmd)
with_errors = false;
else if (cmd == "gt")
p2D = !p2D;
set_dims(!p2D);
else if (cmd == "gt+")
p2D = true;
set_dims(true);
else if (cmd == "gt-")
p2D = false;
set_dims(false);
else
throw "unknown command " + cmd;
......
......@@ -34,6 +34,9 @@ public:
int equipoints; //!< Start curve plot with this # grid points.
bool refine; //!< Refine curve plot when appropriate?
void set_dims(const bool _p2D);
void set_aux(const std::string& cmd);
void gp_write(const std::string& in);
void start_frame1D(
const std::string& caller, const std::string& xlabel, const std::string& ylabel);
......@@ -53,7 +56,6 @@ public:
void write_postscript(
const std::string& fname, const std::string& mode, const bool withDefs,
std::map<const std::string, std::string>&& settings);
void set_aux(const std::string& cmd);
std::string info() const;
private:
......
......@@ -165,21 +165,25 @@ namespace {
ret += "[\n";
if (A->logflag && (Tacks[0] < 1e-3 || Tacks[ntack - 1] > 1e3)) {
for (int i = 0; i < ntack; i++)
ret += str(format(" %9.6f {(10)(%i)sp()} %%{(%g)}\n")
% A->pc(Tacks[i])
ret += str(format(" %g w%s {(10)(%i)sp()} %%{(%g)}\n")
% (float)Tacks[i]
% A->name
% (int)(log10(Tacks[i]))
% (float)Tacks[i]);
} else {
for (int i = 0; i < ntack; i++)
ret += str(format(" %9.6f {(%g)}\n")
% A->pc(Tacks[i])
ret += str(format(" %g w%s {(%g)}\n")
% (float)Tacks[i]
% A->name
% (float)Tacks[i]);
}
ret += " ] SetTacVec\n";
}
ret += str(format("%g %g %i %i SetTicVec%s\n")
% A->pc(ticklim[0])
% A->pc(ticklim[1])
ret += str(format("%g w%s %g w%s %i %i SetTicVec%s\n")
% (float)ticklim[0]
% A->name
% (float)ticklim[1]
% A->name
% (ntack + 2)
% ntpt
% (A->logflag ? "Log" : "Lin"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment