** EZPLOT
**
** This is part of the CTSim program
-** Copyright (C) 1983-2000 Kevin Rosenberg
+** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ezplot.cpp,v 1.26 2000/12/29 15:45:06 kevin Exp $
+** $Id: ezplot.cpp,v 1.31 2001/02/20 04:48:45 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
EZPlotCurve::EZPlotCurve (const double* xData, const double* yData, int n)
-: x(NULL), y(NULL)
+: x(new double[n]), y(new double[n])
{
- x = new double [n];
- y = new double [n];
-
- int copyCount = n * sizeof(double);
- memcpy (x, xData, copyCount);
- memcpy (y, yData, copyCount);
+ for (int i = 0; i < n; i++) {
+ x[i] = xData[i];
+ y[i] = yData[i];
+ }
m_iPointCount = n;
}
}
void
-EZPlot::addCurve (const double x[], const float y[], int num)
+EZPlot::addCurve (const double* const x, const float* const y, int num)
{
double* dy = new double [num];
void
-EZPlot::addCurve (const double x[], const double y[], int num)
+EZPlot::addCurve (const double* const x, const double* const y, int num)
{
if (num < 1)
return;
EZPlot::EZPlot ()
{
- initKeywords();\r
- m_pol.addSkipWord ("please");\r
- m_pol.addSkipWord ("use");\r
- m_pol.addSkipWord ("are");\r
- m_pol.addSkipWord ("and");\r
- m_pol.addSkipWord ("is");\r
- m_pol.addSkipWord ("the");\r
- m_pol.addSkipWord ("equals");\r
- m_pol.addSkipChar ('=');\r
- \r
- m_pol.usefile (POL::P_USE_STR,"");\r
- m_pol.set_inputline ("!eoc ,");\r
- m_pol.reader ();\r
- m_pol.closefile ();\r
-\r
+ 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
EZPlot::initPlotSettings ()
{
- m_iCurrentCurve = -1;\r
- m_pSGP = NULL;\r
+ m_iCurrentCurve = -1;
+
+ m_pSGP = NULL;
+
c_xlabel = "";
c_ylabel = "";
s_ylegend = FALSE;
s_textsize = FALSE;
- clr_axis = C_BLACK; // set fixed colors
+ clr_axis = C_LTGRAY; // set fixed colors
clr_title = C_RED;
clr_label = C_BLUE;
clr_legend = C_CYAN;
clr_grid = C_LTGRAY;
}
-void\r
-EZPlot::setColor (unsigned int iCurve, int iColor)\r
-{\r
- if (m_veciColor.size() <= iCurve) {\r
- m_veciColor.resize ((m_iCurrentCurve + 1) * 2);\r
- m_vecbColorSet.resize ((m_iCurrentCurve + 1) * 2);\r
- }\r
- m_veciColor [iCurve] = iColor;\r
- m_vecbColorSet [iCurve] = true;\r
-}\r
-\r
-void\r
-EZPlot::setSymbol (unsigned int iCurve, int iSymbol)\r
-{\r
- if (m_veciSymbol.size() <= iCurve) {\r
- m_veciSymbol.resize ((m_iCurrentCurve + 1) * 2);\r
- m_vecbSymbolSet.resize ((m_iCurrentCurve + 1) * 2);\r
- }\r
- m_veciSymbol [iCurve] = iSymbol;\r
- m_vecbSymbolSet [iCurve] = true;\r
-}\r
-\r
-void\r
-EZPlot::setSymbolFreq (unsigned int iCurve, int iSymbolFreq)\r
-{\r
- if (m_veciSymbolFreq.size() <= iCurve) {\r
- m_veciSymbolFreq.resize ((m_iCurrentCurve + 1) * 2);\r
- m_vecbSymbolFreqSet.resize ((m_iCurrentCurve + 1) * 2);\r
- }\r
- m_veciSymbolFreq [iCurve] = iSymbolFreq;\r
- m_vecbSymbolFreqSet [iCurve] = true;\r
-}\r
-\r
-void\r
-EZPlot::setLinestyle (unsigned int iCurve, int iLinestyle)\r
-{\r
- if (m_veciLinestyle.size() <= iCurve) {\r
- m_veciLinestyle.resize ((m_iCurrentCurve + 1) * 2);\r
- m_vecbLinestyleSet.resize ((m_iCurrentCurve + 1) * 2);\r
- }\r
- m_veciLinestyle [iCurve] = iLinestyle;\r
- m_vecbLinestyleSet [iCurve] = true;\r
-}\r
-\r
-void\r
-EZPlot::setLegend (unsigned int iCurve, const std::string& strLegend)\r
-{\r
- if (m_vecsLegend.size() <= iCurve) {\r
- m_vecsLegend.resize ((m_iCurrentCurve + 1) * 2);\r
- m_vecbLegendSet.resize ((m_iCurrentCurve + 1) * 2);\r
- }\r
- m_vecsLegend [iCurve] = strLegend;\r
- m_vecbLegendSet [iCurve] = true;\r
-}\r
-\r
-void\r
-EZPlot::setLegend (unsigned int iCurve, const char* const pszLegend)\r
-{\r
- if (m_vecsLegend.size() <= iCurve) {\r
- m_vecsLegend.resize ((m_iCurrentCurve + 1) * 2);\r
- m_vecbLegendSet.resize ((m_iCurrentCurve + 1) * 2);\r
- }\r
- m_vecsLegend [iCurve] = pszLegend;\r
- m_vecbLegendSet [iCurve] = true;\r
-}\r
-\r
-int\r
-EZPlot::getColor (unsigned int iCurve) const\r
-{\r
- if (m_veciColor.size() > iCurve && m_vecbColorSet[iCurve])\r
- return m_veciColor[iCurve];\r
- else\r
- return o_color;\r
-}\r
- \r
-int\r
-EZPlot::getSymbol (unsigned int iCurve) const\r
-{\r
- if (m_veciSymbol.size() > iCurve && m_vecbSymbolSet[iCurve])\r
- return m_veciSymbol[iCurve];\r
- else\r
- return o_symbol;\r
-}\r
- \r
-int\r
-EZPlot::getSymbolFreq (unsigned int iCurve) const\r
-{\r
- if (m_veciSymbolFreq.size() > iCurve && m_vecbSymbolFreqSet[iCurve])\r
- return m_veciSymbolFreq[iCurve];\r
- else\r
- return o_symfreq;\r
-}\r
- \r
-int\r
-EZPlot::getLinestyle (unsigned int iCurve) const\r
-{\r
- if (m_veciLinestyle.size() > iCurve && m_vecbLinestyleSet[iCurve])\r
- return m_veciLinestyle[iCurve];\r
- else\r
- return o_linestyle;\r
-}\r
- \r
-const std::string*\r
-EZPlot::getLegend (unsigned int iCurve) const\r
-{\r
- if (m_vecsLegend.size() > iCurve && m_vecbLegendSet[iCurve])\r
- return &m_vecsLegend[iCurve];\r
- else\r
- return NULL;\r
-}\r
- \r
-\r
+void
+
+EZPlot::setColor (unsigned int iCurve, int iColor)
+
+{
+
+ if (m_veciColor.size() <= iCurve) {
+
+ m_veciColor.resize ((m_iCurrentCurve + 1) * 2);
+
+ m_vecbColorSet.resize ((m_iCurrentCurve + 1) * 2);
+
+ }
+
+ m_veciColor [iCurve] = iColor;
+
+ m_vecbColorSet [iCurve] = true;
+
+}
+
+
+
+void
+
+EZPlot::setSymbol (unsigned int iCurve, int iSymbol)
+
+{
+
+ if (m_veciSymbol.size() <= iCurve) {
+
+ m_veciSymbol.resize ((m_iCurrentCurve + 1) * 2);
+
+ m_vecbSymbolSet.resize ((m_iCurrentCurve + 1) * 2);
+
+ }
+
+ m_veciSymbol [iCurve] = iSymbol;
+
+ m_vecbSymbolSet [iCurve] = true;
+
+}
+
+
+
+void
+
+EZPlot::setSymbolFreq (unsigned int iCurve, int iSymbolFreq)
+
+{
+
+ if (m_veciSymbolFreq.size() <= iCurve) {
+
+ m_veciSymbolFreq.resize ((m_iCurrentCurve + 1) * 2);
+
+ m_vecbSymbolFreqSet.resize ((m_iCurrentCurve + 1) * 2);
+
+ }
+
+ m_veciSymbolFreq [iCurve] = iSymbolFreq;
+
+ m_vecbSymbolFreqSet [iCurve] = true;
+
+}
+
+
+
+void
+
+EZPlot::setLinestyle (unsigned int iCurve, int iLinestyle)
+
+{
+
+ if (m_veciLinestyle.size() <= iCurve) {
+
+ m_veciLinestyle.resize ((m_iCurrentCurve + 1) * 2);
+
+ m_vecbLinestyleSet.resize ((m_iCurrentCurve + 1) * 2);
+
+ }
+
+ m_veciLinestyle [iCurve] = iLinestyle;
+
+ m_vecbLinestyleSet [iCurve] = true;
+
+}
+
+
+
+void
+
+EZPlot::setLegend (unsigned int iCurve, const std::string& strLegend)
+
+{
+
+ if (m_vecsLegend.size() <= iCurve) {
+
+ m_vecsLegend.resize ((m_iCurrentCurve + 1) * 2);
+
+ m_vecbLegendSet.resize ((m_iCurrentCurve + 1) * 2);
+
+ }
+
+ m_vecsLegend [iCurve] = strLegend;
+
+ m_vecbLegendSet [iCurve] = true;
+
+}
+
+
+
+void
+
+EZPlot::setLegend (unsigned int iCurve, const char* const pszLegend)
+
+{
+
+ if (m_vecsLegend.size() <= iCurve) {
+
+ m_vecsLegend.resize ((m_iCurrentCurve + 1) * 2);
+
+ m_vecbLegendSet.resize ((m_iCurrentCurve + 1) * 2);
+
+ }
+
+ m_vecsLegend [iCurve] = pszLegend;
+
+ m_vecbLegendSet [iCurve] = true;
+
+}
+
+
+
+int
+
+EZPlot::getColor (unsigned int iCurve) const
+
+{
+
+ if (m_veciColor.size() > iCurve && m_vecbColorSet[iCurve])
+
+ return m_veciColor[iCurve];
+
+ else
+
+ return o_color;
+
+}
+
+
+
+int
+
+EZPlot::getSymbol (unsigned int iCurve) const
+
+{
+
+ if (m_veciSymbol.size() > iCurve && m_vecbSymbolSet[iCurve])
+
+ return m_veciSymbol[iCurve];
+
+ else
+
+ return o_symbol;
+
+}
+
+
+
+int
+
+EZPlot::getSymbolFreq (unsigned int iCurve) const
+
+{
+
+ if (m_veciSymbolFreq.size() > iCurve && m_vecbSymbolFreqSet[iCurve])
+
+ return m_veciSymbolFreq[iCurve];
+
+ else
+
+ return o_symfreq;
+
+}
+
+
+
+int
+
+EZPlot::getLinestyle (unsigned int iCurve) const
+
+{
+
+ if (m_veciLinestyle.size() > iCurve && m_vecbLinestyleSet[iCurve])
+
+ return m_veciLinestyle[iCurve];
+
+ else
+
+ return o_linestyle;
+
+}
+
+
+
+const std::string*
+
+EZPlot::getLegend (unsigned int iCurve) const
+
+{
+
+ if (m_vecsLegend.size() > iCurve && m_vecbLegendSet[iCurve])
+
+ return &m_vecsLegend[iCurve];
+
+ else
+
+ return NULL;
+
+}
+
+
+
+
+
/* NAME
* plot Plots all curves collected by addCurves ()
*
void
EZPlot::plot (SGP* pSGP)
-{\r
+{
+
if (m_vecCurves.size() <= 0)
return;
- \r
- m_pSGP = pSGP;\r
+
+
+ m_pSGP = pSGP;
+
m_pSGP->setWindow (0., 0., 1., 1.);
if (s_textsize == TRUE)
- m_pSGP->setTextPointSize (v_textsize);\r
+ m_pSGP->setTextPointSize (v_textsize);
+
charheight = m_pSGP->getCharHeight();
charwidth = m_pSGP->getCharWidth();
- const EZPlotCurve& firstCurve = *m_vecCurves[0];\r
+ const EZPlotCurve& firstCurve = *m_vecCurves[0];
+
double xmin = firstCurve.x[0]; // extent of curves in world coord
double xmax = xmin;
double ymin = firstCurve.y[0];
- double ymax = ymin; \r
+ double ymax = ymin;
+
unsigned int iCurve;
for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
const EZPlotCurve* const pCurve = m_vecCurves [iCurve];
ya_max = yp_max;
// adjust frame for title
- title_row = ya_max;;\r
+ title_row = ya_max;;
+
if (c_title.length() > 0)
- ya_max -= 2 * charheight;\r
- else\r
- ya_max -= 0.7 * charheight; // allow room for yaxis ticklabel\r
+ ya_max -= 2 * charheight;
+
+ else
+
+ ya_max -= 0.7 * charheight; // allow room for yaxis ticklabel
+
// calculate legend box boundaries
int max_leg = 0; // longest legend in characters
- int num_leg = 0; // number of legend titles \r
+ int num_leg = 0; // number of legend titles
+
for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
- const std::string* pstrLegend = getLegend (iCurve);\r
- if (pstrLegend && pstrLegend->length() > 0) {\r
+ const std::string* pstrLegend = getLegend (iCurve);
+
+ if (pstrLegend && pstrLegend->length() > 0) {
+
int nLegend = pstrLegend->length();
if (nLegend > 0) {
++num_leg;
- if (nLegend > max_leg)\r
- nLegend = max_leg;\r
+ if (nLegend > max_leg)
+
+ nLegend = max_leg;
+
}
}
}
m_pSGP->setColor (clr_legend);
m_pSGP->drawRect (xl_min, yl_min, xl_max, yl_max);
- int iLegend = 0; // current legend position \r
+ int iLegend = 0; // current legend position
+
for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
const std::string* pstrLegend = getLegend (iCurve);
if (! pstrLegend || pstrLegend->length() == 0)
double xmax = xl_max - 1.0 * charwidth;
double y = yl_max - (2.0 + iLegend * 3) * charheight;
- m_pSGP->moveAbs (xmin, y + 0.5 * charheight);\r
+ m_pSGP->moveAbs (xmin, y + 0.5 * charheight);
+
m_pSGP->drawText (pstrLegend->c_str());
- m_pSGP->setColor (getColor (iCurve));\r
+ m_pSGP->setColor (getColor (iCurve));
+
int iLS = getLinestyle (iCurve);
if (iLS != SGP::LS_NOLINE) {
m_pSGP->setLineStyle (iLS);
m_pSGP->moveAbs (xmin, y);
m_pSGP->lineAbs (xmax, y);
- }\r
+ }
+
int iSymbol = getSymbol (iCurve);
if (iSymbol > 0) {
double xinc = (xmax - xmin) / (5 - 1);
xlbl_row = xp_min; // put x-label on bottom of plot frame
// Y-Label
- if (c_ylabel.length() > 0) {\r
- m_pSGP->setTextAngle (HALFPI);\r
- m_pSGP->setTextSize (1.5 * charheight);\r
- double xExtent, yExtent;\r
- m_pSGP->getTextExtent (c_ylabel.c_str(), &xExtent, &yExtent);\r
- m_pSGP->setTextSize (charheight);\r
- xa_min += xExtent;\r
- m_pSGP->setTextAngle (0.0);\r
+ if (c_ylabel.length() > 0) {
+
+ m_pSGP->setTextAngle (HALFPI);
+
+ m_pSGP->setTextSize (1.5 * charheight);
+
+ double xExtent, yExtent;
+
+ m_pSGP->getTextExtent (c_ylabel.c_str(), &xExtent, &yExtent);
+
+ m_pSGP->setTextSize (charheight);
+
+ xa_min += xExtent;
+
+ m_pSGP->setTextAngle (0.0);
+
}
ylbl_col = xp_min;
if (o_yaxis == NOAXIS || o_ytlabel == FALSE)
ytl_ofs = 0.0;
- else if (o_yticks == LEFT)
- ytl_ofs = -(2 + y_fldwid) * charwidth;
- else if (o_yticks == RIGHT)
+ else if (o_yticks == LEFT) {
+ double xExtentMin, xExtentMax, yExtent;
+ char s[1024];
+ snprintf (s, sizeof(s), y_numfmt, ymin);
+ m_pSGP->getTextExtent (s, &xExtentMin, &yExtent);
+ snprintf (s, sizeof(s), y_numfmt, ymax);
+ m_pSGP->getTextExtent (s, &xExtentMax, &yExtent);
+ if (xExtentMin > xExtentMax)
+ xExtentMax = xExtentMin;
+ ytl_ofs = -xExtentMax;
+ } else if (o_yticks == RIGHT)
ytl_ofs = 1.5 * charwidth;
- xa_max -= 0.7 * x_fldwid * charwidth; // make room for last x tick label\r
-\r
+ 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;
if (ytl_ofs != 0.0 && s_xcross == FALSE) {
if (o_yticks == LEFT) {
- xa_min += (2 + y_fldwid) * charwidth;
+ xa_min += 2*charwidth - ytl_ofs; // (2 + y_fldwid) * charwidth;
xt_min = xa_min;
} else if (o_yticks == RIGHT) {
xa_min += 0.0;
- xt_min = xa_min + ytl_ofs + y_fldwid * charwidth;
+ xt_min = xa_min + ytl_ofs; // + y_fldwid * charwidth;
}
} else
xt_min = xa_min;
// size of symbol in NDC
double symwidth = charwidth;
double symheight = charheight;
- \r
- double clipRect[4];\r
- clipRect[0] = xgn_min; clipRect[1] = ygn_min; clipRect[2] = xgn_max; clipRect[3] = ygn_max;\r
-\r
+
+
+ double clipRect[4];
+
+ clipRect[0] = xgn_min; clipRect[1] = ygn_min; clipRect[2] = xgn_max; clipRect[3] = ygn_max;
+
+
+
for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
const EZPlotCurve* const pCurve = m_vecCurves [iCurve];
- \r
- m_pSGP->setColor (getColor (iCurve));\r
- int iSym = getSymbol (iCurve);\r
- int iLS = getLinestyle (iCurve);\r
-\r
+
+
+ m_pSGP->setColor (getColor (iCurve));
+
+ int iSym = getSymbol (iCurve);
+
+ int iLS = getLinestyle (iCurve);
+
+
+
if (iLS != SGP::LS_NOLINE) {
m_pSGP->setLineStyle (iLS);
double x1 = convertWorldToNDC_X (pCurve->x[0]);
- double y1 = convertWorldToNDC_Y (pCurve->y[0]);\r
+ double y1 = convertWorldToNDC_Y (pCurve->y[0]);
+
for (int i = 1; i < pCurve->m_iPointCount; i++) {
double x2 = convertWorldToNDC_X (pCurve->x[i]);
- double y2 = convertWorldToNDC_Y (pCurve->y[i]);\r
- double x2Clip = x2;\r
- double y2Clip = y2;\r
- if (clip_rect (x1, y1, x2Clip, y2Clip, clipRect)) {\r
- m_pSGP->moveAbs (x1, y1);\r
- m_pSGP->lineAbs (x2Clip, y2Clip);\r
- }\r
- x1 = x2;\r
- y1 = y2;\r
+ double y2 = convertWorldToNDC_Y (pCurve->y[i]);
+
+ double x2Clip = x2;
+
+ double y2Clip = y2;
+
+ if (clip_rect (x1, y1, x2Clip, y2Clip, clipRect)) {
+
+ m_pSGP->moveAbs (x1, y1);
+
+ m_pSGP->lineAbs (x2Clip, y2Clip);
+
+ }
+
+ x1 = x2;
+
+ y1 = y2;
+
}
}
- if (iSym > 0) {\r
+ if (iSym > 0) {
+
int iSymFreq = getSymbolFreq (iCurve);
m_pSGP->setLineStyle (SGP::LS_SOLID);
double x = convertWorldToNDC_X (pCurve->x[0]);
for (int i = 1; i < pCurve->m_iPointCount; i++)
if (i % iSymFreq == 0 || i == pCurve->m_iPointCount - 1) {
x = convertWorldToNDC_X (pCurve->x[i]);
- y = convertWorldToNDC_Y (pCurve->y[i]);\r
+ y = convertWorldToNDC_Y (pCurve->y[i]);
+
if (y >= ygn_min && y <= ygn_max) {
m_pSGP->moveAbs (x, y);
- symbol (iSym, symwidth, symheight);\r
+ symbol (iSym, symwidth, symheight);
+
}
}
}
- }
-
+ }
}
}
}
m_pSGP->setTextSize (charheight * 1.5);
- m_pSGP->setTextColor (clr_label, -1);\r
- double wText, hText;\r
+ m_pSGP->setTextColor (clr_label, -1);
+
+ double wText, hText;
+
m_pSGP->getTextExtent (c_xlabel.c_str(), &wText, &hText);
- m_pSGP->moveAbs (xa_min + (xa_max-xa_min)/2 - wText / 2, xlbl_row + charheight * 1.5);\r
+ m_pSGP->moveAbs (xa_min + (xa_max-xa_min)/2 - wText / 2, xlbl_row + charheight * 1.5);
+
m_pSGP->drawText (c_xlabel);
m_pSGP->setTextSize (charheight);
minorinc = xn_tickinc / (o_xminortick + 1);
if (o_xtlabel == TRUE && axis_near == FALSE) {
snprintf (str, sizeof(str), x_numfmt, xgw_min + xw_tickinc * i);
numstr = str_skip_head (str, " ");
- m_pSGP->moveAbs (x-strlen(numstr)*charwidth/2, xaxispos + xtl_ofs);
+ double xExtent, yExtent;
+ m_pSGP->getTextExtent (numstr, &xExtent, &yExtent);
+ m_pSGP->moveAbs (x - xExtent/2, xaxispos + xtl_ofs);
m_pSGP->setTextColor (clr_number, -1);
m_pSGP->drawText (numstr);
}
m_pSGP->moveAbs (xa_max, y);
m_pSGP->lineAbs (xa_min, y);
}
- }\r
+ }
+
m_pSGP->setTextAngle (HALFPI);
m_pSGP->setTextSize (1.5 * charheight);
- m_pSGP->setTextColor (clr_label, -1);\r
- double xExtent, yExtent;\r
- m_pSGP->getTextExtent (c_ylabel.c_str(), &xExtent, &yExtent);\r
- m_pSGP->moveAbs (ylbl_col, ya_min + (ya_max-ya_min)/2 - yExtent / 2);\r
- m_pSGP->drawText (c_ylabel);\r
+ m_pSGP->setTextColor (clr_label, -1);
+
+ double xExtent, yExtent;
+
+ m_pSGP->getTextExtent (c_ylabel.c_str(), &xExtent, &yExtent);
+ m_pSGP->moveAbs (ylbl_col, ya_min + (ya_max-ya_min)/2 - yExtent / 2);
+ m_pSGP->drawText (c_ylabel);
+
m_pSGP->setTextAngle (0.0);
m_pSGP->setTextSize (charheight);
minorinc = yn_tickinc / (o_yminortick + 1);
axis_near = TRUE;
}
if (o_ytlabel == TRUE && axis_near == FALSE) {
- snprintf (str, sizeof(str), y_numfmt, ygw_min + yw_tickinc * i);\r
- m_pSGP->moveAbs (yaxispos + ytl_ofs, y + 0.5 * charheight);\r
- m_pSGP->setTextColor (clr_number, -1);\r
+ snprintf (str, sizeof(str), y_numfmt, ygw_min + yw_tickinc * i);
+ double xExtent, yExtent;
+ m_pSGP->getTextExtent (str, &xExtent, &yExtent);
+ if (o_yticks == LEFT)
+ m_pSGP->moveAbs (yaxispos - 1.5 * charwidth - xExtent, y + 0.5 * yExtent);
+ else
+ m_pSGP->moveAbs (yaxispos + 1.5 * charwidth, y + 0.5 * yExtent);
+ m_pSGP->setTextColor (clr_number, -1);
m_pSGP->drawText (str);
}
}
double g = floor (mina / wdt);
if (fabs(g + 1 - mina / wdt) < j)
g = g + 1;
-#undef TEST1\r
+#undef TEST1
+
#ifdef TEST1
g++;
#endif
double delta = (maxval - minval) / nint;
double absmin = fabs(minval);
- double absmax = fabs(maxval);\r
- if (absmin > absmax)\r
+ double absmax = fabs(maxval);
+
+ if (absmin > absmax)
+
absmax = absmin;
double logt = log10( absmax );