X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctgraphics%2Fezplot.cpp;h=72f7e5149fbbfdbc9ff0ea53b4b5ed810db6e397;hp=eab8cc37bebda290d0428b3b64a9a5ca98ab66e2;hb=df761d2b3cac3d347f4ef0f9f69e88d3bb66b2fa;hpb=fd726516dd11fd37a675a94c1e7165c47d793b34 diff --git a/libctgraphics/ezplot.cpp b/libctgraphics/ezplot.cpp index eab8cc3..72f7e51 100644 --- a/libctgraphics/ezplot.cpp +++ b/libctgraphics/ezplot.cpp @@ -6,7 +6,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ezplot.cpp,v 1.23 2000/12/26 21:13:15 kevin Exp $ +** $Id: ezplot.cpp,v 1.25 2000/12/27 20:09:19 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -137,7 +137,22 @@ EZPlot::clearCurves () EZPlot::EZPlot (SGP& sgp) : rSGP (sgp) { - initPlotSettings(); + initKeywords(); + m_pol.addSkipWord ("please"); + m_pol.addSkipWord ("use"); + m_pol.addSkipWord ("are"); + m_pol.addSkipWord ("and"); + m_pol.addSkipWord ("is"); + m_pol.addSkipWord ("the"); + m_pol.addSkipWord ("equals"); + m_pol.addSkipChar ('='); + + m_pol.usefile (POL::P_USE_STR,""); + m_pol.set_inputline ("!eoc ,"); + m_pol.reader (); + m_pol.closefile (); + + initPlotSettings(); } void @@ -544,17 +559,19 @@ EZPlot::plot () if (o_xaxis == NOAXIS || o_xtlabel == FALSE) xtl_ofs = 0.0; else if (o_xticks == BELOW) - xtl_ofs = -1.5 * charheight; + xtl_ofs = -0.5 * charheight; else if (o_xticks == ABOVE) - xtl_ofs = 1.5 * charheight; + xtl_ofs = 0.5 * charheight; if (o_yaxis == NOAXIS || o_ytlabel == FALSE) ytl_ofs = 0.0; else if (o_yticks == LEFT) - ytl_ofs = -(1 + y_fldwid) * charwidth; + ytl_ofs = -(2 + y_fldwid) * charwidth; else if (o_yticks == RIGHT) ytl_ofs = 1.5 * charwidth; + xa_max -= 0.7 * x_fldwid * charwidth; // make room for last x tick label + xt_min = xa_min; yt_min = ya_min; xt_max = xa_max; @@ -563,18 +580,18 @@ EZPlot::plot () // see if need to shrink axis extents and/or tick extents if (xtl_ofs != 0.0 && s_ycross == FALSE) { if (o_xticks == BELOW) { - ya_min += 2.5 * charheight; + ya_min += 1.5 * charheight; yt_min = ya_min; } else if (o_xticks == ABOVE) { ya_min += 0.0; - yt_min = ya_min + 2.5 * charheight; + yt_min = ya_min + 1.5 * charheight; } } else // noaxis, no t-labels, or user set cross yt_min = ya_min; if (ytl_ofs != 0.0 && s_xcross == FALSE) { if (o_yticks == LEFT) { - xa_min += (1 + y_fldwid) * charwidth; + xa_min += (2 + y_fldwid) * charwidth; xt_min = xa_min; } else if (o_yticks == RIGHT) { xa_min += 0.0; @@ -582,7 +599,7 @@ EZPlot::plot () } } else xt_min = xa_min; - + // decrease size of graph, if necessary, to accommadate space // between axis boundary and boundary of ticks double x_added_ticks = 0; // number of tick spaces added to axis @@ -713,9 +730,9 @@ EZPlot::drawAxes() rSGP.setTextColor (1, -1); if (o_xticks == ABOVE) - xticklen = charheight; + xticklen = 0.5 * charheight; else if (o_xticks == BELOW) - xticklen = -charheight; + xticklen = -0.5 * charheight; if (o_yticks == RIGHT) yticklen = charwidth; @@ -884,8 +901,8 @@ EZPlot::drawAxes() axis_near = TRUE; } if (o_ytlabel == TRUE && axis_near == FALSE) { - snprintf (str, sizeof(str), y_numfmt, ygw_min + yw_tickinc * i); - rSGP.moveAbs (yaxispos + ytl_ofs, y + 0.5 * charheight); + snprintf (str, sizeof(str), y_numfmt, ygw_min + yw_tickinc * i); + rSGP.moveAbs (yaxispos + ytl_ofs, y + 0.5 * charheight); rSGP.setTextColor (clr_number, -1); rSGP.drawText (str); }