forked from SiegeLord/RustGnuplot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbox_and_whisker.rs
More file actions
45 lines (40 loc) · 896 Bytes
/
box_and_whisker.rs
File metadata and controls
45 lines (40 loc) · 896 Bytes
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
44
45
// This file is released into Public Domain.
use crate::common::*;
use gnuplot::*;
mod common;
fn example(c: Common)
{
let mut fg = Figure::new();
fg.axes2d()
.set_title("Box and whisker", &[])
.box_and_whisker(
[0.0f32, 1.0, 2.0].iter(),
[-1.0f32, 0.0, 1.0].iter(),
[-2.0f32, -1.0, 0.0].iter(),
[2.0f32, 3.0, 4.0].iter(),
[1.0f32, 2.0, 3.0].iter(),
&[],
)
.box_and_whisker_set_width(
[-0.6f32, 1.5, 2.5].iter(),
[-1.0f32, 0.0, 1.0].iter(),
[-2.0f32, -1.0, 0.0].iter(),
[2.0f32, 3.0, 4.0].iter(),
[1.0f32, 2.0, 3.0].iter(),
[0.5f32, 0.25, 0.125].iter(),
&[
WhiskerBars(0.5),
Color("blue".into()),
LineWidth(2.0),
LineStyle(SmallDot),
FillAlpha(0.5),
],
)
.set_x_range(Fix(-1.0), Fix(3.0))
.set_y_range(Fix(-3.0), Fix(5.0));
c.show(&mut fg, "box_and_whisker");
}
fn main()
{
Common::new().map(|c| example(c));
}