Changeset 1198
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Graph.cc
r1197 r1198 115 115 116 116 pls_.col0(1); 117 // FIXME: loop over segments instead of revs, i.e., use Vector::iterator 118 for (unsigned int i=1; i<y.size(); ++i) { 119 PLFLT x0=i-1; 120 PLFLT x1=i; 121 if (date_xticks()) { 122 x0=xticks_[i-1]; 123 x1=xticks_[i]; 124 } 125 pls_.join(x0, y[i-1], x0, y[i]); 126 pls_.join(x0, y[i] , x1, y[i]); 127 } 117 118 SumVector::const_iterator iter = y.begin(); 119 svn_revnum_t x0=0; 120 PLFLT y0=0; 121 for (; iter!=y.end(); ++iter) { 122 staircase(x0, y0, iter->first, iter->second); 123 x0 = iter->first; 124 y0 = iter->second; 125 } 126 staircase(x0, y0, y.size()-1, y0); 128 127 129 128 legend_data legend; … … 169 168 170 169 170 void Graph::staircase(svn_revnum_t rev0, PLFLT y0, 171 svn_revnum_t rev1, PLFLT y1) 172 { 173 PLFLT x0 = rev0; 174 PLFLT x1 = rev1; 175 if (date_xticks()) { 176 x0 = xticks_[rev0]; 177 x1 = xticks_[rev1]; 178 } 179 #ifdef HAVE_PLPLOT 180 // join {x0,x0} with {x1,y1} via {x1,y0} 181 pls_.join(x0,y0,x1,y0); 182 pls_.join(x1,y0,x1,y1); 183 #endif 184 } 185 186 171 187 unsigned int Graph::tick_spacing(const double range) const 172 188 { -
trunk/lib/Graph.h
r1197 r1198 138 138 void current_color(const legend_data&); 139 139 void print_legend(void); 140 void staircase(svn_revnum_t rev0, PLFLT y0, svn_revnum_t rev1, PLFLT y1); 140 141 unsigned int tick_spacing(const double range) const; 141 142
Note: See TracChangeset
for help on using the changeset viewer.