MCPcopy Create free account
hub / github.com/cpmech/plotpy / draw_mat_works_2

Function draw_mat_works_2

src/boxplot.rs:408–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

406
407 #[test]
408 fn draw_mat_works_2() {
409 let x = vec![
410 // A B C D E
411 vec![1, 2, 3, 4, 5],
412 vec![2, 3, 4, 5, 6],
413 vec![3, 4, 5, 6, 7],
414 vec![4, 5, 6, 7, 8],
415 vec![5, 6, 7, 8, 9],
416 vec![6, 7, 8, 9, 10],
417 ];
418 let mut boxes = Boxplot::new();
419 boxes
420 .set_symbol("b+")
421 .set_no_fliers(true)
422 .set_horizontal(true)
423 .set_whisker(1.5)
424 .set_positions(&[1.0, 2.0, 3.0, 4.0, 5.0])
425 .set_width(0.5)
426 .draw_mat(&x);
427 let b: &str = "x=np.array([[1,2,3,4,5,],[2,3,4,5,6,],[3,4,5,6,7,],[4,5,6,7,8,],[5,6,7,8,9,],[6,7,8,9,10,],])\n\
428 positions=[1,2,3,4,5,]\n\
429 p=plt.boxplot(x,sym=r'b+',vert=False,whis=1.5,positions=positions,widths=0.5,showfliers=False)\n";
430 assert_eq!(boxes.buffer, b);
431 boxes.clear_buffer();
432 assert_eq!(boxes.buffer, "");
433 }
434}

Callers

nothing calls this directly

Calls 8

draw_matMethod · 0.80
set_positionsMethod · 0.80
set_whiskerMethod · 0.80
set_no_fliersMethod · 0.80
set_symbolMethod · 0.80
set_widthMethod · 0.45
set_horizontalMethod · 0.45
clear_bufferMethod · 0.45

Tested by

no test coverage detected