File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ use std::ops::Range;
66/// This is useful, for example, when we have an X axis is a integer and denotes days.
77/// And we are expecting the tick mark denotes weeks, in this way we can make the range
88/// spec grouping by 7 elements.
9+ /// With the help of the GroupBy decorator, this can be archived quite easily:
10+ ///```rust
11+ ///use plotters::prelude::*;
12+ ///let mut buf = vec![0;1024*768*3];
13+ ///let area = BitMapBackend::with_buffer(buf.as_mut(), (1024, 768)).into_drawing_area();
14+ ///let chart = ChartBuilder::on(&area)
15+ /// .build_ranged((0..100).group_by(7), 0..100)
16+ /// .unwrap();
17+ ///```
918#[ derive( Clone ) ]
1019pub struct GroupBy < T : DiscreteRanged > ( T , usize ) ;
1120
Original file line number Diff line number Diff line change 11// The code that is related to float number handling
2-
32fn find_minimal_repr ( n : f64 , eps : f64 ) -> ( f64 , usize ) {
43 if eps >= 1.0 {
54 return ( n, 0 ) ;
You can’t perform that action at this time.
0 commit comments