pub struct Scatter3dPlot { /* private fields */ }
Expand description
A structure representing a 3D scatter plot.
The Scatter3dPlot
struct is designed to create and customize 3D scatter plots with options for data selection,
grouping, layout configuration, and aesthetic adjustments. It supports visual differentiation in data groups
through varied marker shapes, colors, sizes, opacity levels, and comprehensive layout customization, including
titles, axis labels, and legends.
§Arguments
data
- A reference to theDataFrame
containing the data to be plotted.x
- A string slice specifying the column name to be used for the x-axis (independent variable).y
- A string slice specifying the column name to be used for the y-axis (dependent variable).z
- A string slice specifying the column name to be used for the z-axis, adding a third dimension to the scatter plot.group
- An optional string slice specifying the column name used for grouping data points by category.opacity
- An optionalf64
value specifying the opacity of the plot markers (range: 0.0 to 1.0).size
- An optionalusize
specifying the size of the markers.color
- An optionalRgb
value for marker color whengroup
is not specified.colors
- An optional vector ofRgb
values specifying colors for markers whengroup
is specified, enhancing group distinction.shape
- An optionalShape
specifying the shape of markers whengroup
is not specified.shapes
- An optional vector ofShape
values defining multiple marker shapes for different groups.plot_title
- An optionalText
struct specifying the plot title.x_title
- An optionalText
struct for the x-axis title.y_title
- An optionalText
struct for the y-axis title.z_title
- An optionalText
struct for the z-axis title.legend_title
- An optionalText
struct specifying the legend title.x_axis
- An optional reference to anAxis
struct for custom x-axis settings.y_axis
- An optional reference to anAxis
struct for custom y-axis settings.z_axis
- An optional reference to anAxis
struct for custom z-axis settings, adding depth perspective.legend
- An optional reference to aLegend
struct for legend customization, including position and font settings.
§Example
use plotlars::{Legend, Plot, Rgb, Scatter3dPlot, Shape};
let dataset = LazyCsvReader::new("data/penguins.csv")
.finish()
.unwrap()
.select([
col("species"),
col("sex").alias("gender"),
col("bill_length_mm").cast(DataType::Float32),
col("flipper_length_mm").cast(DataType::Int16),
col("body_mass_g").cast(DataType::Int16),
])
.collect()
.unwrap();
Scatter3dPlot::builder()
.data(&dataset)
.x("body_mass_g")
.y("flipper_length_mm")
.z("bill_length_mm")
.group("species")
.opacity(0.25)
.size(8)
.colors(vec![
Rgb(178, 34, 34),
Rgb(65, 105, 225),
Rgb(255, 140, 0),
])
.shapes(vec![
Shape::Circle,
Shape::Square,
Shape::Diamond,
])
.plot_title("Scatter Plot")
.legend(
&Legend::new()
.x(0.6)
)
.build()
.plot();
Implementations§
Source§impl Scatter3dPlot
impl Scatter3dPlot
Trait Implementations§
Source§impl Clone for Scatter3dPlot
impl Clone for Scatter3dPlot
Source§fn clone(&self) -> Scatter3dPlot
fn clone(&self) -> Scatter3dPlot
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 Scatter3dPlot
impl !RefUnwindSafe for Scatter3dPlot
impl !Send for Scatter3dPlot
impl !Sync for Scatter3dPlot
impl Unpin for Scatter3dPlot
impl !UnwindSafe for Scatter3dPlot
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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