pub fn render_face_points(
    s: &[(f64, f64)],
    x_axis: &axis::ContinuousAxis,
    y_axis: &axis::ContinuousAxis,
    face_width: u32,
    face_height: u32,
    style: &style::PointStyle,
) -> String {
    let points: Vec<_> = s
        .iter()
        .map(|&(x, y)| {
            (
                value_to_axis_cell_offset(x, x_axis, face_width),
                value_to_axis_cell_offset(y, y_axis, face_height),
            )
        })
        .collect();

    let marker = match style.get_marker() {
        style::PointMarker::Circle => '●',
        style::PointMarker::Square => '■',
        style::PointMarker::Cross => '×',
    };

    let mut face_strings: Vec<String> = vec![];
    for line in 1..=face_height {
        let mut line_string = String::new();
        for column in 1..=face_width as usize {
            line_string.push(if points.contains(&(column as i32, line as i32)) {
                marker
            } else {
                ' '
            });
        }
        face_strings.push(line_string);
    }
    let face_strings: Vec<String> = face_strings.iter().rev().cloned().collect();
    face_strings.join("\n")
}
/// Given a scatter plot,
/// the x ands y-axes
/// and the face height and width,
/// create the strings to be drawn as the face
Given a scatter plot,
the x ands y-axes
and the face height and width,
create the strings to be drawn as the face
Given a scatter plot the x ands y - axes and the face height and width create the strings to be drawn as the face
pub fn render_face_points(
    s: &[(f64, f64)],
    x_axis: &axis::ContinuousAxis,
    y_axis: &axis::ContinuousAxis,
    face_width: u32,
    face_height: u32,
    style: &style::PointStyle,
) -> String {
    let points: Vec<_> = s
        .iter()
        .map(|&(x, y)| {
            (
                value_to_axis_cell_offset(x, x_axis, face_width),
                value_to_axis_cell_offset(y, y_axis, face_height),
            )
        })
        .collect();
    let marker = match style.get_marker() {
        style::PointMarker::Circle => '●',
        style::PointMarker::Square => '■',
        style::PointMarker::Cross => '×',
    };
    let mut face_strings: Vec<String> = vec![];
    for line in 1..=face_height {
        let mut line_string = String::new();
        for column in 1..=face_width as usize {
            line_string.push(if points.contains(&(column as i32, line as i32)) {
                marker
            } else {
                ' '
            });
        }
        face_strings.push(line_string);
    }
    let face_strings: Vec<String> = face_strings.iter().rev().cloned().collect();
    face_strings.join("\n")
}
pub fn render_face_points ( s : & [ ( f64 , f64 ) ] , x_axis : & axis :: ContinuousAxis , y_axis : & axis :: ContinuousAxis , face_width : u32 , face_height : u32 , style : & style :: PointStyle , ) -> String { let points : Vec < _ > = s . iter ( ) . map ( | & ( x , y ) | { ( value_to_axis_cell_offset ( x , x_axis , face_width ) , value_to_axis_cell_offset ( y , y_axis , face_height ) , ) } ) . collect ( ) ; let marker = match style . get_marker ( ) { style :: PointMarker :: Circle => '●', style :: PointMarker :: Square => '■', style :: PointMarker :: Cross => '×', } ; let mut face_strings : Vec < String > = vec ! [ ] ; for line in 1 ..= face_height { let mut line_string = String :: new ( ) ; for column in 1 ..= face_width as usize { line_string . push ( if points . contains ( & ( column as i32 , line as i32 ) ) { marker } else { ' ' } ) ; } face_strings . push ( line_string ) ; } let face_strings : Vec < String > = face_strings . iter ( ) . rev ( ) . cloned ( ) . collect ( ) ; face_strings . join ( " \n " ) }
Given a scatter plot,
the x ands y-axes
and the face height and width,
create the strings to be drawn as the face
Given a scatter plot the x ands y - axes and the face height and width create the strings to be drawn as the face
s
&[(f64, f64)]
x_axis
&axis::ContinuousAxis
y_axis
&axis::ContinuousAxis
face_width
u32
face_height
u32
style
&style::PointStyle
s
&[(f64, f64)]
x_axis
&axis::ContinuousAxis
y_axis
&axis::ContinuousAxis
face_width
u32
face_height
u32
style
&style::PointStyle