Skip to content

Commit 2ea05f9

Browse files
committed
Add a few minor docs
1 parent 40d2a0a commit 2ea05f9

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/function.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
/*!
2+
3+
Plot arbitrary functions
4+
5+
# Examples
6+
7+
```
8+
# use plotlib::function::Function;
9+
# use plotlib::view::View;
10+
// y=x^2 between 0 and 10
11+
let f = Function::new(|x| x*x, 0., 10.);
12+
let v = View::new().add(&f);
13+
```
14+
*/
15+
116
use std::f64;
217

318
use svg;
419

520
use axis;
621
use representation::Representation;
7-
822
use svg_render;
923

1024
#[derive(Debug)]
@@ -115,13 +129,3 @@ impl Representation for Function {
115129
"".into()
116130
}
117131
}
118-
119-
#[cfg(test)]
120-
mod tests {
121-
use super::*;
122-
123-
#[test]
124-
fn test_function() {
125-
let f = Function::new(|x| x*x, 0., 10.);
126-
}
127-
}

src/histogram.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ use svg_render;
2828
use text_render;
2929
use representation::Representation;
3030

31+
/**
32+
A one-dimensional histogram with equal binning.
33+
*/
3134
#[derive(Debug)]
3235
pub struct Histogram {
3336
pub bin_bounds: Vec<f64>, // will have N_bins + 1 entries

0 commit comments

Comments
 (0)