Changeset 209 for trunk/lib/Stats.cc
- Timestamp:
- Sep 12, 2006, 2:14:10 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Stats.cc
r208 r209 157 157 158 158 std::string Stats::plot(const std::string& filename, 159 const std::string& title) const 159 const std::string& title, 160 const std::string& linetype) const 160 161 { 161 162 GnuplotFE* gp=GnuplotFE::instance(); … … 168 169 gp->command("set key left Left reverse"); 169 170 gp->command("set multiplot"); 170 std::vector<u_int> total=accumulated(total_); 171 const Map_* stat=NULL; 172 if (linetype=="total") 173 stat = &total_; 174 else if (linetype=="code") 175 stat = &code_; 176 else if (linetype=="comments") 177 stat = &comments_; 178 else if (linetype=="empty") 179 stat = &empty_; 180 assert(stat); 181 std::vector<u_int> total=accumulated(*stat); 171 182 double yrange_max=1.03*total.back()+1; 172 183 gp->yrange(yrange_max); 173 184 size_t plotno=1; 174 185 std::stringstream ss; 175 for (MapConstIter_ i= total_.begin(); i != total_.end(); ++i) {186 for (MapConstIter_ i= stat->begin(); i != stat->end(); ++i) { 176 187 ss.str(""); 177 188 ss << "set key height " << 2*plotno; 178 189 gp->command(ss.str()); 179 std::vector<u_int> x=accumulated( total_, i->first);190 std::vector<u_int> x=accumulated(*stat, i->first); 180 191 ss.str(""); 181 192 ss << x.back() << " " << i->first;
Note: See TracChangeset
for help on using the changeset viewer.