pub struct DataToPixel { /* private fields */ }Expand description
Full data→pixel mapping for a single axes panel.
Implementations§
Source§impl DataToPixel
impl DataToPixel
pub fn new(x_scale: ScaleKind, y_scale: ScaleKind, pixel_rect: Rect) -> Self
Sourcepub fn with_invert_y(self, invert: bool) -> Self
pub fn with_invert_y(self, invert: bool) -> Self
Enable / disable inverted y mapping (matplotlib Axes.invert_yaxis).
pub fn invert_y(self) -> bool
pub fn pixel_rect(self) -> Rect
pub fn x_scale(self) -> ScaleKind
pub fn y_scale(self) -> ScaleKind
Sourcepub fn map(&self, data: Point) -> Point
pub fn map(&self, data: Point) -> Point
Map a data point into pixel space (y grows downward on screen).
pub fn map_x(&self, x: f64) -> f64
pub fn map_y(&self, y: f64) -> f64
Trait Implementations§
Source§impl Clone for DataToPixel
impl Clone for DataToPixel
impl Copy for DataToPixel
Auto Trait Implementations§
impl Freeze for DataToPixel
impl RefUnwindSafe for DataToPixel
impl Send for DataToPixel
impl Sync for DataToPixel
impl Unpin for DataToPixel
impl UnsafeUnpin for DataToPixel
impl UnwindSafe for DataToPixel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more