Struct termplot::ViewCanvas
source · pub struct ViewCanvas<'view> { /* private fields */ }
Expand description
The view where graphs are graphed and plots are plotted.
Braille characters are use to draw on the canvas. termplot
uses drawille::Canvas
for
darwing.
Implementations§
source§impl<'view> ViewCanvas<'view>
impl<'view> ViewCanvas<'view>
sourcepub fn line(&mut self, x0: f64, y0: f64, x1: f64, y1: f64)
pub fn line(&mut self, x0: f64, y0: f64, x1: f64, y1: f64)
Draw a line from the point (x0
, y0
) to (x1
, y1
).
The coordinate are of the plotting space, and not the actual pixel’s coordinate.
This function uses the domain and codomain of the View
to determine which pixels should
be drawn. Therefor the drawn shape is relative to the position of the domain and codomain
of the plotting space.
sourcepub fn point(&mut self, x: f64, y: f64)
pub fn point(&mut self, x: f64, y: f64)
Draw a point at (x
, y
).
The coordinate are of the plotting space, and not the actual pixel’s coordinate.
This function uses the domain and codomain of the View
to determine which pixels should
be drawn. Therefor the drawn shape is relative to the position of the domain and codomain
of the plotting space.