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

Method draw

src/boxplot.rs:139–149  ·  view source on GitHub ↗

Draws the box plot given a nested list of values Each inner `Vec` produces one box. Groups can have different sizes. # Input `data` -- a sequence of 1D arrays; one box is drawn per sub-array See also: [`draw_mat`](Self::draw_mat) for matrix-oriented data

(&mut self, data: &Vec<Vec<T>>)

Source from the content-addressed store, hash-verified

137 ///
138 /// See also: [`draw_mat`](Self::draw_mat) for matrix-oriented data
139 pub fn draw<T>(&mut self, data: &Vec<Vec<T>>)
140 where
141 T: std::fmt::Display + Num,
142 {
143 generate_nested_list(&mut self.buffer, "x", data);
144 if self.positions.len() > 0 {
145 generate_list(&mut self.buffer, "positions", self.positions.as_slice());
146 }
147 let opt = self.options();
148 write!(&mut self.buffer, "p=plt.boxplot(x{})\n", &opt).unwrap();
149 }
150
151 /// Draws the box plot given a 2D matrix of values
152 ///

Callers 2

draw_works_1Function · 0.45
draw_works_2Function · 0.45

Calls 3

generate_nested_listFunction · 0.85
generate_listFunction · 0.85
optionsMethod · 0.45

Tested by 2

draw_works_1Function · 0.36
draw_works_2Function · 0.36