Changeset 2088 in Sophya
- Timestamp:
- Jul 11, 2002, 11:29:39 PM (23 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/piaxes.cc
r2085 r2088 5 5 6 6 #include "machdefs.h" 7 #include "piaxes.h"8 7 #include <stdio.h> 9 8 #include <math.h> 9 #include "piaxes.h" 10 10 11 11 inline void dble_SWAP(double a, double b) {double tmp=a; a=b; b=tmp;} … … 63 63 64 64 if (flags & kMajTicks) { 65 DrawHTicks(g, (yMin+yMax)/2., xMajTickLen, xMajTickLen, x FirstMajTick, xMajTickStep);66 DrawVTicks(g, (xMin+xMax)/2., yMajTickLen, yMajTickLen, y FirstMajTick, yMajTickStep);65 DrawHTicks(g, (yMin+yMax)/2., xMajTickLen, xMajTickLen, xMajTicks); 66 DrawVTicks(g, (xMin+xMax)/2., yMajTickLen, yMajTickLen, yMajTicks); 67 67 } 68 68 … … 70 70 71 71 if (flags & kMinTicks) { 72 DrawHTicks(g, (yMin+yMax)/2., xMinTickLen, xMinTickLen, x FirstMinTick, xMinTickStep);73 DrawVTicks(g, (xMin+xMax)/2., yMinTickLen, yMinTickLen, y FirstMinTick, yMinTickStep);72 DrawHTicks(g, (yMin+yMax)/2., xMinTickLen, xMinTickLen, xMinTicks); 73 DrawVTicks(g, (xMin+xMax)/2., yMinTickLen, yMinTickLen, yMinTicks); 74 74 } 75 75 … … 78 78 if (flags & kLabels) { 79 79 if (!aYdir) 80 DrawHLabels(g, (yMin+yMax)/2.-xMajTickLen*2, x FirstMajTick, xMajTickStep,PI_VerticalTop);80 DrawHLabels(g, (yMin+yMax)/2.-xMajTickLen*2, xMajTicks, PI_VerticalTop); 81 81 else 82 DrawHLabels(g, (yMin+yMax)/2.+xMajTickLen*2, x FirstMajTick, xMajTickStep,PI_VerticalTop);82 DrawHLabels(g, (yMin+yMax)/2.+xMajTickLen*2, xMajTicks, PI_VerticalTop); 83 83 if (!aXdir) 84 DrawVLabels(g, (xMin+xMax)/2.-yMajTickLen*2, y FirstMajTick, yMajTickStep,PI_HorizontalRight);84 DrawVLabels(g, (xMin+xMax)/2.-yMajTickLen*2, yMajTicks, PI_HorizontalRight); 85 85 else 86 DrawVLabels(g, (xMin+xMax)/2.+yMajTickLen*2, y FirstMajTick, yMajTickStep,PI_HorizontalRight);86 DrawVLabels(g, (xMin+xMax)/2.+yMajTickLen*2, yMajTicks, PI_HorizontalRight); 87 87 } 88 88 … … 116 116 117 117 if (flags & kMajTicks) { 118 DrawHTicks(g, yMin, intXMajTickLen, extXMajTickLen, x FirstMajTick, xMajTickStep);119 DrawHTicks(g, yMax, extXMajTickLen, intXMajTickLen, x FirstMajTick, xMajTickStep);120 DrawVTicks(g, xMin, extYMajTickLen, intYMajTickLen, y FirstMajTick, yMajTickStep);121 DrawVTicks(g, xMax, intYMajTickLen, extYMajTickLen, y FirstMajTick, yMajTickStep);118 DrawHTicks(g, yMin, intXMajTickLen, extXMajTickLen, xMajTicks); 119 DrawHTicks(g, yMax, extXMajTickLen, intXMajTickLen, xMajTicks); 120 DrawVTicks(g, xMin, extYMajTickLen, intYMajTickLen, yMajTicks); 121 DrawVTicks(g, xMax, intYMajTickLen, extYMajTickLen, yMajTicks); 122 122 } 123 123 … … 125 125 126 126 if (flags & kMinTicks) { 127 DrawHTicks(g, yMin, intXMinTickLen, extXMinTickLen, x FirstMinTick, xMinTickStep);128 DrawHTicks(g, yMax, extXMinTickLen, intXMinTickLen, x FirstMinTick, xMinTickStep);129 DrawVTicks(g, xMin, extYMinTickLen, intYMinTickLen, y FirstMinTick, yMinTickStep);130 DrawVTicks(g, xMax, intYMinTickLen, extYMinTickLen, y FirstMinTick, yMinTickStep);127 DrawHTicks(g, yMin, intXMinTickLen, extXMinTickLen, xMinTicks); 128 DrawHTicks(g, yMax, extXMinTickLen, intXMinTickLen, xMinTicks); 129 DrawVTicks(g, xMin, extYMinTickLen, intYMinTickLen, yMinTicks); 130 DrawVTicks(g, xMax, intYMinTickLen, extYMinTickLen, yMinTicks); 131 131 } 132 132 … … 136 136 if (flags & kLabels) { 137 137 if (!aYdir) { 138 DrawHLabels(g, g->DeltaUCY(yMin, -xMajTickLen*2), xFirstMajTick, xMajTickStep,PI_VerticalTop); 139 //DrawHLabels(g, g->DeltaUCY(yMax, xMajTickLen*2), xFirstMajTick, xMajTickStep,PI_VerticalBottom); 138 DrawHLabels(g, g->DeltaUCY(yMin, -xMajTickLen*2), xMajTicks, PI_VerticalTop); 140 139 } 141 140 else { 142 //DrawHLabels(g, g->DeltaUCY(yMin, -xMajTickLen*2), xFirstMajTick, xMajTickStep,PI_VerticalBottom); 143 DrawHLabels(g, g->DeltaUCY(yMax, xMajTickLen*2), xFirstMajTick, xMajTickStep,PI_VerticalTop); 141 DrawHLabels(g, g->DeltaUCY(yMax, xMajTickLen*2), xMajTicks, PI_VerticalTop); 144 142 } 145 143 if (!aXdir) { 146 DrawVLabels(g, g->DeltaUCX(xMin, -yMajTickLen*2), yFirstMajTick, yMajTickStep,PI_HorizontalRight); 147 //DrawVLabels(g, g->DeltaUCX(xMax, yMajTickLen*2), yFirstMajTick, yMajTickStep,PI_HorizontalLeft); 144 DrawVLabels(g, g->DeltaUCX(xMin, -yMajTickLen*2), yMajTicks, PI_HorizontalRight); 148 145 } 149 146 else { 150 //DrawVLabels(g, g->DeltaUCX(xMin, -yMajTickLen*2), yFirstMajTick, yMajTickStep,PI_HorizontalLeft); 151 DrawVLabels(g, g->DeltaUCX(xMax, yMajTickLen*2), yFirstMajTick, yMajTickStep,PI_HorizontalRight); 147 DrawVLabels(g, g->DeltaUCX(xMax, yMajTickLen*2), yMajTicks, PI_HorizontalRight); 152 148 } 153 149 } … … 171 167 172 168 int ntick_x = (aXlog) ? 6 : 10; 173 BestTicks(xMin,xMax,ntick_x,xMajTickStep,xFirstMajTick); 174 xMinTickStep = xMajTickStep/5; 175 xFirstMinTick = floor(xMin / xMinTickStep) * xMinTickStep; 176 if(xFirstMinTick < xMin) xFirstMinTick += xMinTickStep; 169 BestTicks(xMin,xMax,ntick_x,xMajTicks,xMinTicks); 177 170 178 171 int ntick_y = (aYlog) ? 6 : 12; 179 BestTicks(yMin,yMax,ntick_y,yMajTickStep,yFirstMajTick); 180 yMinTickStep = yMajTickStep/5; 181 yFirstMinTick = floor(yMin / yMinTickStep) * yMinTickStep; 182 if(yFirstMinTick < yMin) yFirstMinTick += yMinTickStep; 172 BestTicks(yMin,yMax,ntick_y,yMajTicks,yMinTicks); 183 173 184 174 yMajTickLen = (xMax-xMin)/100; … … 191 181 /* --Methode-- */ 192 182 void PIAxes::DrawHTicks(PIGraphicUC* g, double y, double tickUp, 193 double tickDown, double xBeg, double xStep) 194 { 195 for (double x=xBeg; x<=xMax+xStep/10.; x += xStep) 196 g->DrawLine(x, g->DeltaUCY(y, -tickDown), x, g->DeltaUCY(y, tickUp)); 183 double tickDown, vector<double>& xticks) 184 { 185 if(xticks.size()<=0) return; 186 for(unsigned int i=0;i<xticks.size();i++) { 187 if(xticks[i]>xMax) break; 188 g->DrawLine(xticks[i],g->DeltaUCY(y,-tickDown),xticks[i],g->DeltaUCY(y,tickUp)); 189 } 197 190 } 198 191 199 192 /* --Methode-- */ 200 193 void PIAxes::DrawVTicks(PIGraphicUC* g, double x, double tickLeft, 201 double tickRight, double yBeg, double yStep) 202 { 203 for (double y=yBeg; y<=yMax; y += yStep) 204 g->DrawLine(g->DeltaUCX(x, -tickLeft), y, g->DeltaUCX(x,tickRight), y); 205 } 206 207 /* --Methode-- */ 208 void PIAxes::DrawHLabels(PIGraphicUC* g, double y, double xBeg, 209 double xStep, unsigned long just) 210 { 211 194 double tickRight, vector<double>& yticks) 195 { 196 if(yticks.size()<=0) return; 197 for(unsigned int i=0;i<yticks.size();i++) { 198 if(yticks[i]>yMax) break; 199 g->DrawLine(g->DeltaUCX(x,-tickLeft),yticks[i],g->DeltaUCX(x,tickRight),yticks[i]); 200 } 201 } 202 203 /* --Methode-- */ 204 void PIAxes::DrawHLabels(PIGraphicUC* g, double y, vector<double>& xticks, unsigned long just) 205 { 206 207 if(xticks.size()<=1) return; 212 208 // Choix du bon format pour les labels des axes; 213 209 char label[64]; string format; double fac=1.; bool p10=false; 214 int npuiss = BonFormatAxes(xBeg,xMax,xStep,format,2,1); 210 double xstep=xticks[1]-xticks[0]; 211 int npuiss = BonFormatAxes(xticks[0],xMax,xstep,format,2,1); 215 212 if(npuiss<-2 || npuiss>3) {p10 = true; fac=pow(10.,(double)npuiss);} 216 else BonFormatAxes(x Beg,xMax,xStep,format,0,1);213 else BonFormatAxes(xticks[0],xMax,xstep,format,0,1); 217 214 218 215 double xOffset = 0; 219 double xlastlabelfin = xBeg - 2.*(xMax-xBeg); 220 for(double x=xBeg; x<=xMax+xStep/10.; x+=xStep) { 216 double xlastlabelfin = xticks[0] - 2.*(xMax-xticks[0]); 217 for(unsigned int i=0;i<xticks.size();i++) { 218 if(xticks[i]>xMax) break; 221 219 //Attention erreur d'arrondi x->0 (on code 5.1698e-26 au lieu de 0) 222 double xx = (fabs(x /xStep)<1.e-5) ? 0.: x;220 double xx = (fabs(xticks[i]/xstep)<1.e-5) ? 0.: xticks[i]; 223 221 sprintf(label,format.c_str(),xx/fac); 224 for(int kk=0;kk<64;kk++) if(label[kk]==' ') {label[kk]='\0'; break;}222 Arrange_Label(label); 225 223 double largeur = g->CalcStringWidth(label); 226 224 if(aXdir) xOffset = largeur/2; else xOffset=-largeur/2; 227 if(x +xOffset > xlastlabelfin) {228 g->DrawString(x ,y,label,PI_HorizontalCenter|just);229 xlastlabelfin = x + xOffset + 1.1*largeur;225 if(xticks[i]+xOffset > xlastlabelfin) { 226 g->DrawString(xticks[i],y,label,PI_HorizontalCenter|just); 227 xlastlabelfin = xticks[i] + xOffset + 1.1*largeur; 230 228 } 231 229 } … … 244 242 245 243 /* --Methode-- */ 246 void PIAxes::DrawVLabels(PIGraphicUC* g, double x, double yBeg,247 double yStep, unsigned long just) 248 { 249 244 void PIAxes::DrawVLabels(PIGraphicUC* g, double x, vector<double>& yticks, unsigned long just) 245 { 246 247 if(yticks.size()<=1) return; 250 248 // Choix du bon format pour les labels des axes; 251 249 char label[64]; string format; double fac=1.; bool p10=false; 252 int npuiss = BonFormatAxes(yBeg,yMax,yStep,format,2,1); 250 double ystep=yticks[1]-yticks[0]; 251 int npuiss = BonFormatAxes(yticks[0],yMax,ystep,format,2,1); 253 252 if(npuiss<-2 || npuiss>3) {p10 = true; fac=pow(10.,(double)npuiss);} 254 else BonFormatAxes(yBeg,yMax,yStep,format,0,1); 255 256 for(double y=yBeg; y<=yMax; y += yStep) { 257 double yy = (fabs(y/yStep)<1.e-5) ? 0.: y; 253 else BonFormatAxes(yticks[0],yMax,ystep,format,0,1); 254 255 for(unsigned int i=0;i<yticks.size();i++) { 256 if(yticks[i]>yMax) break; 257 double yy = (fabs(yticks[i]/ystep)<1.e-5) ? 0.: yticks[i]; 258 258 sprintf(label,format.c_str(),yy/fac); 259 for(int kk=0;kk<64;kk++) if(label[kk]==' ') {label[kk]='\0'; break;}260 g->DrawString(x,y ,label,PI_VerticalCenter|just);259 Arrange_Label(label); 260 g->DrawString(x,yticks[i],label,PI_VerticalCenter|just); 261 261 } 262 262 … … 276 276 { 277 277 PILineAtt savlineatt = g->GetLineAtt(); 278 // g->SelLine(PI_ThinDashedLine);279 278 g->SelLine(PI_ThinDottedLine); 280 279 281 for (double x=xFirstMajTick; x<=xMax; x += xMajTickStep) 282 g->DrawLine(x, yMin, x, yMax); 283 284 for (double y=yFirstMajTick; y<=yMax; y += yMajTickStep) 285 g->DrawLine(xMin, y, xMax, y); 280 if(xMajTicks.size()>0) 281 for(unsigned int i=0;i<xMajTicks.size();i++) { 282 if(xMajTicks[i]>xMax) break; 283 g->DrawLine(xMajTicks[i], yMin, xMajTicks[i], yMax); 284 } 285 286 if(yMajTicks.size()>0) 287 for(unsigned int i=0;i<yMajTicks.size();i++) { 288 if(yMajTicks[i]>yMax) break; 289 g->DrawLine(xMin, yMajTicks[i], xMax, yMajTicks[i]); 290 } 286 291 287 292 g->SelLine(savlineatt); … … 292 297 /* --Methode-Static-- */ 293 298 void PIAxes::BestTicks(double xmin,double xmax,int nticks 294 ,double& steptick,double& xfirsttick)299 ,vector<double>& majticks,vector<double>& minticks) 295 300 // *** Calcul de l'intervalle entre les ticks et de la valeur du premier tick 296 301 { 297 double d=xmax-xmin; if(d<1.e-100) d=1.e-100; //if (d<1.e-39) d=1.e-39; 298 double ld = log10(d); 299 double fld = floor( ((ld<0.)? -ld: ld) ); 300 double del,del0; 301 if(ld>=0.) {fld-=1.; del0=del=pow(10.,fld);} 302 else {fld+=2.; del0=del=pow(10.,-fld);} 303 // *** Intervalle entre les ticks 304 // xmin xmax d ld fld -->fld del0 305 // 1 1500 1499 3.17 3 2 10^2 306 // 1 9500 9499 3.98 3 2 10^2 307 // 1 1.005 0.005 -2.3 2 4 10^-4 308 // 1 1.995 0.995 -0.0022 0 2 10^-2 309 // - Et recherche de la valeur del={del0,2*del0,...,20*del0} 310 // telle que "nticks*del" soit le plus petit nombre ">=d" 311 // Par exemple, si nticks=10: 312 // 1-/ pour le 2sd cas ou d=9499 et del0=100 : 313 // del = 100 200 500 1000 2000 314 // nticks*del = 1000 2000 5000 10000 20000 315 // d/del = 94.9 47.4 18.9 | 9.499 4.749 ==> majt = 1000 316 // 2-/ pour le 3ieme cas ou d=5e-3 et del0=1e-4 : 317 // del = 1e-4 2e-4 5e-4 1e-3 2e-3 318 // nticks*del = 1e-3 2e-3 5e-3 1e-2 2e-2 319 // d/del = 50 25 | 10 5 2.5 ==> majt = 5e-4 320 int k=0; 321 double fac[4] = {2.,5.,10.,20.}; 322 while(d/del>(double)nticks && k<4 ) {del=fac[k]*del0; k++;} 323 steptick=del; 324 //*** Valeur du premier tick 325 xfirsttick = floor(xmin/steptick); if(xmin<0.) xfirsttick+=1.; 326 xfirsttick *= steptick; 327 if(xfirsttick<xmin) xfirsttick += steptick; 302 double d=xmax-xmin; if(d<1.e-100) d=1.e-100; //if (d<1.e-39) d=1.e-39; 303 double ld = log10(d); 304 double fld = floor( ((ld<0.)? -ld: ld) ); 305 double del,del0; 306 majticks.resize(0); minticks.resize(0); 307 if(ld>=0.) {fld-=1.; del0=del=pow(10.,fld);} 308 else {fld+=2.; del0=del=pow(10.,-fld);} 309 // *** Intervalle entre les ticks 310 // xmin xmax d ld fld -->fld del0 311 // 1 1500 1499 3.17 3 2 10^2 312 // 1 9500 9499 3.98 3 2 10^2 313 // 1 1.005 0.005 -2.3 2 4 10^-4 314 // 1 1.995 0.995 -0.0022 0 2 10^-2 315 // - Et recherche de la valeur del={del0,2*del0,...,20*del0} 316 // telle que "nticks*del" soit le plus petit nombre ">=d" 317 // Par exemple, si nticks=10: 318 // 1-/ pour le 2sd cas ou d=9499 et del0=100 : 319 // del = 100 200 500 1000 2000 320 // nticks*del = 1000 2000 5000 10000 20000 321 // d/del = 94.9 47.4 18.9 | 9.499 4.749 ==> majt = 1000 322 // 2-/ pour le 3ieme cas ou d=5e-3 et del0=1e-4 : 323 // del = 1e-4 2e-4 5e-4 1e-3 2e-3 324 // nticks*del = 1e-3 2e-3 5e-3 1e-2 2e-2 325 // d/del = 50 25 | 10 5 2.5 ==> majt = 5e-4 326 int k=0; 327 double fac[4] = {2.,5.,10.,20.}; 328 while(d/del>(double)nticks && k<4 ) {del=fac[k]*del0; k++;} 329 double steptick=del; 330 //*** Valeur du premier tick 331 double xfirsttick = floor(xmin/steptick); if(xmin<0.) xfirsttick+=1.; 332 xfirsttick *= steptick; 333 if(xfirsttick<xmin) xfirsttick += steptick; 334 majticks.push_back(xfirsttick); 335 while(xfirsttick<=xmax) 336 {xfirsttick+= steptick; majticks.push_back(xfirsttick);} 337 //*** Gestion des ticks mineurs 338 double steptickmin = steptick/5.; 339 double xfirsttickmin = floor(xmin/steptickmin) * steptickmin; 340 if(xfirsttickmin<xmin) xfirsttickmin += steptickmin; 341 minticks.push_back(xfirsttickmin); 342 while(xfirsttickmin<=xmax) 343 {xfirsttickmin+= steptickmin; minticks.push_back(xfirsttickmin);} 328 344 } 329 345 … … 424 440 } 425 441 442 void PIAxes::Arrange_Label(char *label) 443 // Enleve les blancs et les zeros inutiles a la fin d'un label 444 { 445 size_t lenl=strlen(label); 446 if(lenl==0) return; 447 448 // --- On enleve les blancs et plus au debut du label 449 if(label[0]==' ' || label[0]=='+') { 450 char *str=new char[lenl+2]; 451 strcpy(str,label); 452 unsigned i=0; 453 for(i=0;i<lenl;i++) if(str[i]!=' ' && str[i]!='+') break; 454 strcpy(label,&str[i]); 455 delete [] str; 456 lenl=strlen(label); 457 if(lenl==0) return; 458 } 459 460 // --- On enleve les blancs a la fin du label 461 if(label[lenl-1]==' ') { 462 for(unsigned int i=lenl-1;i>=0;i--) { 463 if(label[i]!=' ') break; 464 label[i]='\0'; 465 } 466 lenl=strlen(label); 467 } 468 469 // --- On enleve les e... E... non-significatifs 470 // ex: a.be-zzz a.be+zzz a.bezzz avec zzz=0,00,000,... 471 // Attention on n'enleve pas si: a.be+10 472 // Attention on ne fait rien si: e+10 473 char* e=index(label,'e'); 474 if(e==NULL) e=index(label,'E'); 475 if(e) { 476 for(unsigned int i=lenl-1;i>=0;i--) { 477 if(isdigit(label[i]) && label[i]!='0') break; 478 if(label[i]=='e' || label[i]=='E') 479 {label[i]='\0'; lenl=strlen(label); break;} 480 } 481 } 482 483 // --- On enleve les zeros non-significatifs a la fin du label 484 // On enleve des zeros ou le point si: ab. ab.czzz avec zzz=0,00,000,... 485 // Attention on n'enleve pas de zeros si: abzzz 486 // Attention a ne pas enlever des zeros si on a ab.ccce+a0 487 // Attention on traite 0eaaa -> 0 488 if(index(label,'.')==NULL) return; // Recherche d'un point 489 string stre; 490 if(e) {if(e==label) return; stre=e; *e='\0'; lenl=strlen(label);} 491 for(unsigned int i=lenl-1;i>=0;i--) { 492 if(label[i]=='0') label[i]='\0'; 493 else if(label[i]=='.') { 494 if(i>0) label[i]='\0'; 495 else { 496 // Attention: ".e+10" -> "1e+10" MAIS "." -> "0" 497 if(e) strcpy(label,"1"); else strcpy(label,"0"); 498 } 499 break; 500 } 501 else break; // Ni un point ni un zero 502 } 503 if(e) { 504 if(strlen(label)==1) if(label[0]=='0') return; 505 strcat(label,stre.c_str()); 506 } 507 508 } -
trunk/SophyaPI/PI/piaxes.h
r2080 r2088 9 9 #include "pigraphuc.h" 10 10 #include "pigratt.h" 11 #include <vector> 11 12 12 13 enum { … … 41 42 // virtual void DrawHorizontalAxe(double xmin, double xmax, double y, 42 43 43 // --- Methodes static ---- 44 // Calcul des Distances optimales des subdivisions 44 // Calcul des Distances optimales des subdivisions (STATIC) 45 45 static void BestTicks(double xmin,double xmax,int nticks 46 ,double& steptick,double& xfirsttick); 47 // Calcul du format optimal pour les axes 46 ,vector<double>& majticks,vector<double>& minticks); 47 48 // Calcul du format optimal pour les axes (STATIC) 48 49 static int BonFormatAxes(double xmin,double xmax,double xstep 49 ,string& format,int typf=0,int add_digit=0); 50 ,string& format,int typf=0,int add_digit=0); 51 52 // Mise en forme optimale du format (STATIC) 53 static void Arrange_Label(char *label); 54 50 55 protected: 51 56 void Setup(PIGraphicUC* g, double xmin, double xmax, 52 57 double ymin, double ymax); 53 58 54 void DrawHTicks(PIGraphicUC* g, double y, double tickUp, double tickDown, double xBeg, double xStep);55 void DrawVTicks(PIGraphicUC* g, double x, double tickLeft, double tickRight, double yBeg, double yStep);56 void DrawHLabels(PIGraphicUC* g, double y, double xBeg, double xStep, unsigned long just=0);57 void DrawVLabels(PIGraphicUC* g, double x, double yBeg, double yStep, unsigned long just=0);59 void DrawHTicks(PIGraphicUC* g, double y, double tickUp, double tickDown, vector<double>& xticks); 60 void DrawVTicks(PIGraphicUC* g, double x, double tickLeft, double tickRight, vector<double>& yticks); 61 void DrawHLabels(PIGraphicUC* g, double y, vector<double>& xticks, unsigned long just=0); 62 void DrawVLabels(PIGraphicUC* g, double x, vector<double>& yticks, unsigned long just=0); 58 63 void DrawGrid(PIGraphicUC* g); 59 64 … … 63 68 bool axesAFSz; 64 69 65 double xFirstMajTick, xFirstMinTick;66 double yFirstMajTick, yFirstMinTick;67 double xMajTickStep, xMinTickStep;68 double yMajTickStep, yMinTickStep;70 vector<double> xMajTicks; 71 vector<double> xMinTicks; 72 vector<double> yMajTicks; 73 vector<double> yMinTicks; 69 74 double xMajTickLen, xMinTickLen; 70 75 double yMajTickLen, yMinTickLen; 71 72 76 }; 73 77 -
trunk/SophyaPI/PI/pieldrw.cc
r1970 r2088 85 85 for( k=0; k<opt.size(); k++ ) { 86 86 string opts = opt[k]; 87 if ( (opts == "stdaxes") || (opts == "defaxes") || (opts == "boxaxes") ) 87 if ( (opts == "stdaxes") || (opts == "defaxes") || (opts == "boxaxes") ) 88 88 SetAxesFlags(kBoxAxes | kExtTicks | kLabels); 89 else if (opts == "simpleaxes") 89 else if (opts == "simpleaxes") 90 90 SetAxesFlags(kAxesDflt); 91 else if (opts == "boxaxesgrid") 91 else if (opts == "finesimpleaxes") 92 SetAxesFlags(kAxesDflt | kMinTicks); 93 else if (opts == "boxaxesgrid") 92 94 SetAxesFlags(kBoxAxes | kExtTicks | kLabels | kGridOn); 93 95 else if (opts == "fineaxes") 94 96 SetAxesFlags(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks); 95 else if ((opts == "grid") || (opts == "fineaxesgrid")) 97 else if ((opts == "grid") || (opts == "fineaxesgrid")) 96 98 SetAxesFlags(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks | kGridOn); 97 else if (opts == "autofontsize") 99 else if (opts == "simpleaxesgrid") 100 SetAxesFlags(kAxesDflt | kGridOn); 101 else if (opts == "finesimpleaxesgrid") 102 SetAxesFlags(kAxesDflt | kMinTicks | kGridOn); 103 else if (opts == "autofontsize") 98 104 SetAxesAutoFontSize(true); 99 else if (opts == "fixedfontsize") 105 else if (opts == "fixedfontsize") 100 106 SetAxesAutoFontSize(false); 101 107 else if (opts == "title") ShowTitles(true);
Note:
See TracChangeset
for help on using the changeset viewer.