/// draw the plot to the window. (x,y) is the starting corner, dx is the horizontal distance
/// between points, dy is the scaling factor of the data values to screen values.

draw the plot to the window. (x,y) is the starting corner, dx is the horizontal distance
between points, dy is the scaling factor of the data values to screen values.
draw the plot to the window . ( x y ) is the starting corner dx is the horizontal distance between points dy is the scaling factor of the data values to screen values .
pub fn draw(&self, w: &mut Window, color: &Point3<f32>, x: f32, y: f32, dx: f32, dy: f32) {
        for i in 0..(self.data.len() - 1) {
            let x0 = x + dx * i as f32;
            let x1 = x0 + dx;
            let y0 = y + dy * self.data[i];
            let y1 = y + dy * self.data[i + 1];
            w.draw_planar_line(&Point2::new(x0, y0), &Point2::new(x1, y1), color);
        }
    }
pub fn draw ( & self , w : & mut Window , color : & Point3 < f32 > , x : f32 , y : f32 , dx : f32 , dy : f32 ) { for i in 0 .. ( self . data . len ( ) - 1 ) { let x0 = x + dx * i as f32 ; let x1 = x0 + dx ; let y0 = y + dy * self . data [ i ] ; let y1 = y + dy * self . data [ i + 1 ] ; w . draw_planar_line ( & Point2 :: new ( x0 , y0 ) , & Point2 :: new ( x1 , y1 ) , color ) ; } }
draw the plot to the window.
draw the plot to the window .
&self
w
&mut Window
color
&Point3<f32>
x
f32
y
f32
dx
f32
dy
f32