Legend:
 Unmodified
 Added
 Removed

trunk/lib/Graph.cc
r863 r872 21 21 22 22 #include "Graph.h" 23 24 #include <cmath> 23 25 24 26 namespace theplu { … … 64 66 pls_.scol0a(2,0,0,0,1.0); 65 67 pls_.col0(2); 66 pls_.box("bcnstv", 10, 1, "bcnstv", yrange_/5, 1); 68 unsigned int ytickspacing=tick_spacing(yrange_); 69 unsigned int xtickspacing=tick_spacing(x.size()); 70 pls_.box("bcnstv", xtickspacing, 1, "bcnstv", ytickspacing, 1); 67 71 pls_.col0(1); 68 72 } … … 72 76 pls_.join(i1,x[i],i,x[i]); 73 77 } 78 } 79 80 81 unsigned int Graph::tick_spacing(const double range) const 82 { 83 double frac=range/5; 84 unsigned char characteristic=log10(frac); 85 unsigned int power=pow(10,characteristic); 86 unsigned char msn=frac/power; 87 return power*msn; 74 88 } 75 89 
trunk/lib/Graph.h
r863 r872 73 73 74 74 private: 75 unsigned int tick_spacing(const double range) const; 76 75 77 unsigned int plots_; // keep track of number of plots drawn 76 78 plstream pls_;
Note: See TracChangeset
for help on using the changeset viewer.