MCPcopy Index your code
hub / github.com/cpmech/plotpy / test_boxplot_5

Function test_boxplot_5

tests/test_boxplot.rs:186–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184
185#[test]
186fn test_boxplot_5() -> Result<(), StrError> {
187 let x = vec![
188 vec![1, 2, 3], // A
189 vec![2, 3, 4, 5, 6], // B
190 vec![6, 7], // C
191 ];
192 let mut boxes = Boxplot::new();
193 boxes
194 .set_symbol("b+")
195 .set_no_fliers(true)
196 .set_horizontal(true)
197 .set_whisker(1.5)
198 .set_positions(&[1.0, 2.0, 3.0])
199 .set_width(0.5)
200 .set_patch_artist(true)
201 .set_boxprops("{'facecolor': 'C0', 'edgecolor': 'white','linewidth': 0.5}")
202 .draw(&x);
203 let mut plot = Plot::new();
204 plot.add(&boxes);
205
206 // save figure
207 let path = Path::new(OUT_DIR).join("integ_boxplot_5.svg");
208 plot.save(&path)?;
209
210 // check number of lines
211 let file = File::open(path).map_err(|_| "cannot open file")?;
212 let buffered = BufReader::new(file);
213 let lines_iter = buffered.lines();
214 let c = lines_iter.count();
215 assert!(c > 460 && c < 500);
216 Ok(())
217}

Callers

nothing calls this directly

Calls 11

set_boxpropsMethod · 0.80
set_patch_artistMethod · 0.80
set_positionsMethod · 0.80
set_whiskerMethod · 0.80
set_no_fliersMethod · 0.80
set_symbolMethod · 0.80
saveMethod · 0.80
drawMethod · 0.45
set_widthMethod · 0.45
set_horizontalMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected