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

no longer require tack in log axis

parent c53b0c40
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ void plotaux::calc_ticks(int logscale, double vmin, double vmax, ...@@ -70,7 +70,7 @@ void plotaux::calc_ticks(int logscale, double vmin, double vmax,
static double eins = 1.0000009999999999; static double eins = 1.0000009999999999;
double rlgmin, rlgmax, rlgrel, d1, d2, r0; double rlgmin, rlgmax, rlgrel, d1, d2, r0;
int minexp, maxexp, incr, i1, i2; int minexp, maxexp, incr;
if (vmin <= 0) if (vmin <= 0)
throw string( "PROGRAM ERROR/ Ticks/ negative log argument" ); throw string( "PROGRAM ERROR/ Ticks/ negative log argument" );
...@@ -102,11 +102,9 @@ void plotaux::calc_ticks(int logscale, double vmin, double vmax, ...@@ -102,11 +102,9 @@ void plotaux::calc_ticks(int logscale, double vmin, double vmax,
*tack = (double*) malloc(sizeof(double)*mt); *tack = (double*) malloc(sizeof(double)*mt);
*ntack = 0; *ntack = 0;
i1 = maxexp;
i2 = incr;
d1 = vmin / eins; d1 = vmin / eins;
d2 = vmax * eins; d2 = vmax * eins;
for ( i = minexp; i2 < 0 ? i >= i1 : i <= i1; i += i2 ) { for ( i = minexp; incr < 0 ? i >= maxexp : i <= maxexp; i += incr ) {
r0 = pow(10., i); r0 = pow(10., i);
if (d1<=r0 && r0<=d2) { if (d1<=r0 && r0<=d2) {
if(*ntack>=mt) if(*ntack>=mt)
...@@ -118,9 +116,11 @@ void plotaux::calc_ticks(int logscale, double vmin, double vmax, ...@@ -118,9 +116,11 @@ void plotaux::calc_ticks(int logscale, double vmin, double vmax,
if (*ntack >= 1) { if (*ntack >= 1) {
ticklim[0] = (*tack)[0] / pow(10., incr); ticklim[0] = (*tack)[0] / pow(10., incr);
ticklim[1] = (*tack)[(*ntack)-1] * pow(10., incr); ticklim[1] = (*tack)[(*ntack)-1] * pow(10., incr);
} else } else {
throw string( "plotaux::calc_ticks not implemented:" // untested. just to allow plots when no tacks in window
"tacks when no 10^n in range" ); ticklim[0] = pow( 10., minexp );
ticklim[1] = pow( 10., maxexp+1 );
}
/** determine # ticks / tack **/ /** determine # ticks / tack **/
if (incr==1 && rlgrel<=7) { if (incr==1 && rlgrel<=7) {
......
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