pub struct Array2dPlot { /* private fields */ }
Expand description
A structure representing a 2D array plot.
The Array2dPlot
struct allows for visualizing 2D arrays of RGB color values as images or heatmaps.
Each element in the 2D array corresponds to a pixel, with its color defined by an [u8; 3]
RGB triplet.
This struct supports customizable titles, axis labels, and axis configurations for better presentation.
§Arguments
data
- A 2D vector of RGB triplets (&[Vec<[u8; 3]>]
) representing pixel colors for the plot.plot_title
- An optionalText
struct specifying the title of the plot.x_title
- An optionalText
struct specifying the title of the x-axis.y_title
- An optionalText
struct specifying the title of the y-axis.x_axis
- An optional reference to anAxis
struct for customizing the x-axis.y_axis
- An optional reference to anAxis
struct for customizing the y-axis.
§Example
§Basic 2D Array Plot
use plotlars::{Array2dPlot, Plot, Text};
let data = vec![
vec![[255, 0, 0], [0, 255, 0], [0, 0, 255]],
vec![[0, 0, 255], [255, 0, 0], [0, 255, 0]],
vec![[0, 255, 0], [0, 0, 255], [255, 0, 0]],
];
Array2dPlot::builder()
.data(&data)
.plot_title(
Text::from("Array2D Plot")
.font("Arial")
.size(18)
)
.build()
.plot();
Implementations§
Source§impl Array2dPlot
impl Array2dPlot
Trait Implementations§
Source§impl Clone for Array2dPlot
impl Clone for Array2dPlot
Source§fn clone(&self) -> Array2dPlot
fn clone(&self) -> Array2dPlot
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for Array2dPlot
impl !RefUnwindSafe for Array2dPlot
impl !Send for Array2dPlot
impl !Sync for Array2dPlot
impl Unpin for Array2dPlot
impl !UnwindSafe for Array2dPlot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more