@@ -51,12 +51,7 @@ fn get_min(user_min: Option<f64>, values: &Vec<f64>) -> f64 {
5151 }
5252}
5353
54- fn draw_borders ( bordercol : [ f32 ; 4 ] ,
55- bgcol : [ f32 ; 4 ] ,
56- space : f64 ,
57- m : f64 ,
58- transform : [ [ f64 ; 3 ] ; 2 ] ,
59- g : & mut piston_window:: G2d ) {
54+ fn draw_borders ( bordercol : [ f32 ; 4 ] , bgcol : [ f32 ; 4 ] , space : f64 , m : f64 , transform : [ [ f64 ; 3 ] ; 2 ] , g : & mut piston_window:: G2d ) {
6055 clear ( bordercol, g) ;
6156 rectangle ( [ 0.0 , 0.0 , 1.0 , 1.0 ] ,
6257 [ space - 2.0 , space - 2.0 , m + 4.0 , m + 4.0 ] , // rectangle
@@ -80,11 +75,7 @@ fn set_xy(xy: &Vec<(f64, f64)>, x_vector: &mut Vec<Vec<f64>>, y_vector: &mut Vec
8075 }
8176}
8277
83- fn draw_plots ( window : & mut PistonWindow ,
84- xs : & Vec < Vec < f64 > > ,
85- ys : & Vec < Vec < f64 > > ,
86- colors : & Vec < [ f32 ; 4 ] > ,
87- plot_bounds : [ f64 ; 4 ] ) {
78+ fn draw_plots ( window : & mut PistonWindow , xs : & Vec < Vec < f64 > > , ys : & Vec < Vec < f64 > > , colors : & Vec < [ f32 ; 4 ] > , plot_bounds : [ f64 ; 4 ] ) {
8879 let bordercol = [ 0.95 , 0.95 , 0.95 , 1.0 ] ;
8980 let bgcol = [ 1.0 , 1.0 , 1.0 , 1.0 ] ;
9081 let margin = 0.05 ;
@@ -110,8 +101,7 @@ fn draw_plots(window: &mut PistonWindow,
110101
111102 for i in 0 ..colors. len ( ) {
112103 let color = colors[ i] ;
113- let xt: Vec < f64 > =
114- xs[ i] . iter ( ) . map ( |x| point2plot ( * x, x_min, x_max, m, space) ) . collect ( ) ;
104+ let xt: Vec < f64 > = xs[ i] . iter ( ) . map ( |x| point2plot ( * x, x_min, x_max, m, space) ) . collect ( ) ;
115105 let yt: Vec < f64 > = ys[ i]
116106 . iter ( )
117107 . map ( |y| ( 2.0 * space + m) - point2plot ( * y, y_min, y_max, m, space) )
@@ -134,10 +124,7 @@ fn draw_plots(window: &mut PistonWindow,
134124 }
135125}
136126
137- fn get_plot_bounds ( plot_builder : & PlotBuilder2D ,
138- xs : & Vec < Vec < f64 > > ,
139- ys : & Vec < Vec < f64 > > )
140- -> [ f64 ; 4 ] {
127+ fn get_plot_bounds ( plot_builder : & PlotBuilder2D , xs : & Vec < Vec < f64 > > , ys : & Vec < Vec < f64 > > ) -> [ f64 ; 4 ] {
141128
142129 let mut max_xs: Vec < f64 > = Vec :: new ( ) ;
143130 let mut max_ys: Vec < f64 > = Vec :: new ( ) ;
0 commit comments