-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.rs
43 lines (39 loc) · 1.05 KB
/
main.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use preexplorer::prelude::*;
fn main() -> anyhow::Result<()> {
let data_1: Vec<Vec<f64>> = (1..15)
.map(|i| {
(0..10)
.map(|j| {
let j = j as f64;
let i = i as f64;
// Some computation
i + j / i
})
.collect()
})
.collect();
let data_2: Vec<Vec<f64>> = (1..20)
.map(|i| {
(0..10)
.map(|j| {
let j = j as f64;
let i = i as f64;
// Some computation
-i + j / i
})
.collect()
})
.collect();
let binwidth = 0.3;
(pre::SequenceBin::new(data_1, binwidth)
.set_title("first")
.to_owned()
+ pre::SequenceBin::new(data_2, binwidth)
.set_title("second")
.to_owned())
.set_xlabel("index")
.set_ylabel("value")
.set_title("Overall title")
.plot("my_identifier")?;
Ok(())
}