pub struct Lighting { /* private fields */ }Expand description
A structure describing the lighting model.
§Example
use ndarray::Array;
use plotlars::{ColorBar, Lighting, Palette, Plot, SurfacePlot, Text};
use polars::prelude::*;
use std::iter;
let n: usize = 100;
let x_base: Vec<f64> = Array::linspace(-10.0, 10.0, n).into_raw_vec();
let y_base: Vec<f64> = Array::linspace(-10.0, 10.0, n).into_raw_vec();
let x = x_base
.iter()
.flat_map(|&xi| iter::repeat(xi).take(n))
.collect::<Vec<_>>();
let y = y_base
.iter()
.cycle()
.take(n * n)
.cloned()
.collect::<Vec<_>>();
let z = x_base
.iter()
.map(|i| {
y_base
.iter()
.map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
.collect::<Vec<_>>()
})
.flatten()
.collect::<Vec<_>>();
let dataset = df![
"x" => &x,
"y" => &y,
"z" => &z,
]
.unwrap();
SurfacePlot::builder()
.data(&dataset)
.x("x")
.y("y")
.z("z")
.plot_title(
Text::from("Surface Plot")
.font("Arial")
.size(18),
)
.color_bar(
&ColorBar::new()
.border_width(1),
)
.color_scale(Palette::Cividis)
.reverse_scale(true)
.lighting(
&Lighting::new()
.position(1, 0, 0)
.ambient(1.0)
.diffuse(1.0)
.fresnel(1.0)
.roughness(1.0)
.specular(1.0),
)
.opacity(0.5)
.build()
.plot();
Implementations§
Source§impl Lighting
impl Lighting
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Lighting instance with default values.
Examples found in repository?
examples/mesh3d.rs (line 156)
123fn example_with_lighting() {
124 // Create a simple wavy surface mesh without explicit indices
125 // The mesh will be auto-triangulated
126 let mut x = Vec::new();
127 let mut y = Vec::new();
128 let mut z = Vec::new();
129
130 let n = 20;
131 for i in 0..n {
132 for j in 0..n {
133 let xi = (i as f64 / (n - 1) as f64) * 2.0 - 1.0;
134 let yj = (j as f64 / (n - 1) as f64) * 2.0 - 1.0;
135 x.push(xi);
136 y.push(yj);
137 // Create a wavy surface
138 z.push(0.3 * ((xi * 3.0).sin() + (yj * 3.0).cos()));
139 }
140 }
141
142 let dataset = DataFrame::new(vec![
143 Column::new("x".into(), x),
144 Column::new("y".into(), y),
145 Column::new("z".into(), z),
146 ])
147 .unwrap();
148
149 Mesh3D::builder()
150 .data(&dataset)
151 .x("x")
152 .y("y")
153 .z("z")
154 .color(Rgb(200, 200, 255))
155 .lighting(
156 &Lighting::new()
157 .ambient(0.5)
158 .diffuse(0.8)
159 .specular(0.5)
160 .roughness(0.2)
161 .fresnel(0.2),
162 )
163 .light_position((1, 1, 2))
164 .opacity(1.0)
165 .flat_shading(false)
166 .contour(true)
167 .plot_title(
168 Text::from("Wavy Surface with Custom Lighting")
169 .font("Arial")
170 .size(22),
171 )
172 .build()
173 .plot();
174}More examples
examples/surfaceplot.rs (line 54)
8fn main() {
9 let n: usize = 100;
10 let (x_base, _): (Vec<f64>, Option<usize>) =
11 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
12 let (y_base, _): (Vec<f64>, Option<usize>) =
13 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
14
15 let x = x_base
16 .iter()
17 .flat_map(|&xi| iter::repeat_n(xi, n))
18 .collect::<Vec<_>>();
19
20 let y = y_base
21 .iter()
22 .cycle()
23 .take(n * n)
24 .cloned()
25 .collect::<Vec<_>>();
26
27 let z = x_base
28 .iter()
29 .flat_map(|i| {
30 y_base
31 .iter()
32 .map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
33 .collect::<Vec<_>>()
34 })
35 .collect::<Vec<_>>();
36
37 let dataset = df![
38 "x" => &x,
39 "y" => &y,
40 "z" => &z,
41 ]
42 .unwrap();
43
44 SurfacePlot::builder()
45 .data(&dataset)
46 .x("x")
47 .y("y")
48 .z("z")
49 .plot_title(Text::from("Surface Plot").font("Arial").size(18))
50 .color_bar(&ColorBar::new().border_width(1))
51 .color_scale(Palette::Cividis)
52 .reverse_scale(true)
53 .lighting(
54 &Lighting::new()
55 .position(1, 0, 0)
56 .ambient(1.0)
57 .diffuse(1.0)
58 .fresnel(1.0)
59 .roughness(1.0)
60 .specular(1.0),
61 )
62 .opacity(0.5)
63 .build()
64 .plot();
65}Sourcepub fn position(self, x: i32, y: i32, z: i32) -> Self
pub fn position(self, x: i32, y: i32, z: i32) -> Self
Sets the position of the virtual light source.
§Arguments
x– Ani32value representing the x‑coordinate of the light.y– Ani32value representing the y‑coordinate of the light.z– Ani32value representing the z‑coordinate of the light (positive z points toward the viewer).
Examples found in repository?
examples/surfaceplot.rs (line 55)
8fn main() {
9 let n: usize = 100;
10 let (x_base, _): (Vec<f64>, Option<usize>) =
11 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
12 let (y_base, _): (Vec<f64>, Option<usize>) =
13 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
14
15 let x = x_base
16 .iter()
17 .flat_map(|&xi| iter::repeat_n(xi, n))
18 .collect::<Vec<_>>();
19
20 let y = y_base
21 .iter()
22 .cycle()
23 .take(n * n)
24 .cloned()
25 .collect::<Vec<_>>();
26
27 let z = x_base
28 .iter()
29 .flat_map(|i| {
30 y_base
31 .iter()
32 .map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
33 .collect::<Vec<_>>()
34 })
35 .collect::<Vec<_>>();
36
37 let dataset = df![
38 "x" => &x,
39 "y" => &y,
40 "z" => &z,
41 ]
42 .unwrap();
43
44 SurfacePlot::builder()
45 .data(&dataset)
46 .x("x")
47 .y("y")
48 .z("z")
49 .plot_title(Text::from("Surface Plot").font("Arial").size(18))
50 .color_bar(&ColorBar::new().border_width(1))
51 .color_scale(Palette::Cividis)
52 .reverse_scale(true)
53 .lighting(
54 &Lighting::new()
55 .position(1, 0, 0)
56 .ambient(1.0)
57 .diffuse(1.0)
58 .fresnel(1.0)
59 .roughness(1.0)
60 .specular(1.0),
61 )
62 .opacity(0.5)
63 .build()
64 .plot();
65}Sourcepub fn ambient(self, value: f64) -> Self
pub fn ambient(self, value: f64) -> Self
Sets the ambient light component.
§Arguments
value– Af64value in the range 0.0 – 1.0 specifying the uniform tint strength.
Examples found in repository?
examples/mesh3d.rs (line 157)
123fn example_with_lighting() {
124 // Create a simple wavy surface mesh without explicit indices
125 // The mesh will be auto-triangulated
126 let mut x = Vec::new();
127 let mut y = Vec::new();
128 let mut z = Vec::new();
129
130 let n = 20;
131 for i in 0..n {
132 for j in 0..n {
133 let xi = (i as f64 / (n - 1) as f64) * 2.0 - 1.0;
134 let yj = (j as f64 / (n - 1) as f64) * 2.0 - 1.0;
135 x.push(xi);
136 y.push(yj);
137 // Create a wavy surface
138 z.push(0.3 * ((xi * 3.0).sin() + (yj * 3.0).cos()));
139 }
140 }
141
142 let dataset = DataFrame::new(vec![
143 Column::new("x".into(), x),
144 Column::new("y".into(), y),
145 Column::new("z".into(), z),
146 ])
147 .unwrap();
148
149 Mesh3D::builder()
150 .data(&dataset)
151 .x("x")
152 .y("y")
153 .z("z")
154 .color(Rgb(200, 200, 255))
155 .lighting(
156 &Lighting::new()
157 .ambient(0.5)
158 .diffuse(0.8)
159 .specular(0.5)
160 .roughness(0.2)
161 .fresnel(0.2),
162 )
163 .light_position((1, 1, 2))
164 .opacity(1.0)
165 .flat_shading(false)
166 .contour(true)
167 .plot_title(
168 Text::from("Wavy Surface with Custom Lighting")
169 .font("Arial")
170 .size(22),
171 )
172 .build()
173 .plot();
174}More examples
examples/surfaceplot.rs (line 56)
8fn main() {
9 let n: usize = 100;
10 let (x_base, _): (Vec<f64>, Option<usize>) =
11 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
12 let (y_base, _): (Vec<f64>, Option<usize>) =
13 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
14
15 let x = x_base
16 .iter()
17 .flat_map(|&xi| iter::repeat_n(xi, n))
18 .collect::<Vec<_>>();
19
20 let y = y_base
21 .iter()
22 .cycle()
23 .take(n * n)
24 .cloned()
25 .collect::<Vec<_>>();
26
27 let z = x_base
28 .iter()
29 .flat_map(|i| {
30 y_base
31 .iter()
32 .map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
33 .collect::<Vec<_>>()
34 })
35 .collect::<Vec<_>>();
36
37 let dataset = df![
38 "x" => &x,
39 "y" => &y,
40 "z" => &z,
41 ]
42 .unwrap();
43
44 SurfacePlot::builder()
45 .data(&dataset)
46 .x("x")
47 .y("y")
48 .z("z")
49 .plot_title(Text::from("Surface Plot").font("Arial").size(18))
50 .color_bar(&ColorBar::new().border_width(1))
51 .color_scale(Palette::Cividis)
52 .reverse_scale(true)
53 .lighting(
54 &Lighting::new()
55 .position(1, 0, 0)
56 .ambient(1.0)
57 .diffuse(1.0)
58 .fresnel(1.0)
59 .roughness(1.0)
60 .specular(1.0),
61 )
62 .opacity(0.5)
63 .build()
64 .plot();
65}Sourcepub fn diffuse(self, value: f64) -> Self
pub fn diffuse(self, value: f64) -> Self
Sets the diffuse light component.
§Arguments
value– Af64value in the range 0.0 – 1.0 specifying the Lambertian reflection strength.
Examples found in repository?
examples/mesh3d.rs (line 158)
123fn example_with_lighting() {
124 // Create a simple wavy surface mesh without explicit indices
125 // The mesh will be auto-triangulated
126 let mut x = Vec::new();
127 let mut y = Vec::new();
128 let mut z = Vec::new();
129
130 let n = 20;
131 for i in 0..n {
132 for j in 0..n {
133 let xi = (i as f64 / (n - 1) as f64) * 2.0 - 1.0;
134 let yj = (j as f64 / (n - 1) as f64) * 2.0 - 1.0;
135 x.push(xi);
136 y.push(yj);
137 // Create a wavy surface
138 z.push(0.3 * ((xi * 3.0).sin() + (yj * 3.0).cos()));
139 }
140 }
141
142 let dataset = DataFrame::new(vec![
143 Column::new("x".into(), x),
144 Column::new("y".into(), y),
145 Column::new("z".into(), z),
146 ])
147 .unwrap();
148
149 Mesh3D::builder()
150 .data(&dataset)
151 .x("x")
152 .y("y")
153 .z("z")
154 .color(Rgb(200, 200, 255))
155 .lighting(
156 &Lighting::new()
157 .ambient(0.5)
158 .diffuse(0.8)
159 .specular(0.5)
160 .roughness(0.2)
161 .fresnel(0.2),
162 )
163 .light_position((1, 1, 2))
164 .opacity(1.0)
165 .flat_shading(false)
166 .contour(true)
167 .plot_title(
168 Text::from("Wavy Surface with Custom Lighting")
169 .font("Arial")
170 .size(22),
171 )
172 .build()
173 .plot();
174}More examples
examples/surfaceplot.rs (line 57)
8fn main() {
9 let n: usize = 100;
10 let (x_base, _): (Vec<f64>, Option<usize>) =
11 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
12 let (y_base, _): (Vec<f64>, Option<usize>) =
13 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
14
15 let x = x_base
16 .iter()
17 .flat_map(|&xi| iter::repeat_n(xi, n))
18 .collect::<Vec<_>>();
19
20 let y = y_base
21 .iter()
22 .cycle()
23 .take(n * n)
24 .cloned()
25 .collect::<Vec<_>>();
26
27 let z = x_base
28 .iter()
29 .flat_map(|i| {
30 y_base
31 .iter()
32 .map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
33 .collect::<Vec<_>>()
34 })
35 .collect::<Vec<_>>();
36
37 let dataset = df![
38 "x" => &x,
39 "y" => &y,
40 "z" => &z,
41 ]
42 .unwrap();
43
44 SurfacePlot::builder()
45 .data(&dataset)
46 .x("x")
47 .y("y")
48 .z("z")
49 .plot_title(Text::from("Surface Plot").font("Arial").size(18))
50 .color_bar(&ColorBar::new().border_width(1))
51 .color_scale(Palette::Cividis)
52 .reverse_scale(true)
53 .lighting(
54 &Lighting::new()
55 .position(1, 0, 0)
56 .ambient(1.0)
57 .diffuse(1.0)
58 .fresnel(1.0)
59 .roughness(1.0)
60 .specular(1.0),
61 )
62 .opacity(0.5)
63 .build()
64 .plot();
65}Sourcepub fn fresnel(self, value: f64) -> Self
pub fn fresnel(self, value: f64) -> Self
Sets the Fresnel (edge brightness) component.
§Arguments
value– Af64value in the range 0.0 – 1.0 specifying the rim‑light intensity.
Examples found in repository?
examples/mesh3d.rs (line 161)
123fn example_with_lighting() {
124 // Create a simple wavy surface mesh without explicit indices
125 // The mesh will be auto-triangulated
126 let mut x = Vec::new();
127 let mut y = Vec::new();
128 let mut z = Vec::new();
129
130 let n = 20;
131 for i in 0..n {
132 for j in 0..n {
133 let xi = (i as f64 / (n - 1) as f64) * 2.0 - 1.0;
134 let yj = (j as f64 / (n - 1) as f64) * 2.0 - 1.0;
135 x.push(xi);
136 y.push(yj);
137 // Create a wavy surface
138 z.push(0.3 * ((xi * 3.0).sin() + (yj * 3.0).cos()));
139 }
140 }
141
142 let dataset = DataFrame::new(vec![
143 Column::new("x".into(), x),
144 Column::new("y".into(), y),
145 Column::new("z".into(), z),
146 ])
147 .unwrap();
148
149 Mesh3D::builder()
150 .data(&dataset)
151 .x("x")
152 .y("y")
153 .z("z")
154 .color(Rgb(200, 200, 255))
155 .lighting(
156 &Lighting::new()
157 .ambient(0.5)
158 .diffuse(0.8)
159 .specular(0.5)
160 .roughness(0.2)
161 .fresnel(0.2),
162 )
163 .light_position((1, 1, 2))
164 .opacity(1.0)
165 .flat_shading(false)
166 .contour(true)
167 .plot_title(
168 Text::from("Wavy Surface with Custom Lighting")
169 .font("Arial")
170 .size(22),
171 )
172 .build()
173 .plot();
174}More examples
examples/surfaceplot.rs (line 58)
8fn main() {
9 let n: usize = 100;
10 let (x_base, _): (Vec<f64>, Option<usize>) =
11 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
12 let (y_base, _): (Vec<f64>, Option<usize>) =
13 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
14
15 let x = x_base
16 .iter()
17 .flat_map(|&xi| iter::repeat_n(xi, n))
18 .collect::<Vec<_>>();
19
20 let y = y_base
21 .iter()
22 .cycle()
23 .take(n * n)
24 .cloned()
25 .collect::<Vec<_>>();
26
27 let z = x_base
28 .iter()
29 .flat_map(|i| {
30 y_base
31 .iter()
32 .map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
33 .collect::<Vec<_>>()
34 })
35 .collect::<Vec<_>>();
36
37 let dataset = df![
38 "x" => &x,
39 "y" => &y,
40 "z" => &z,
41 ]
42 .unwrap();
43
44 SurfacePlot::builder()
45 .data(&dataset)
46 .x("x")
47 .y("y")
48 .z("z")
49 .plot_title(Text::from("Surface Plot").font("Arial").size(18))
50 .color_bar(&ColorBar::new().border_width(1))
51 .color_scale(Palette::Cividis)
52 .reverse_scale(true)
53 .lighting(
54 &Lighting::new()
55 .position(1, 0, 0)
56 .ambient(1.0)
57 .diffuse(1.0)
58 .fresnel(1.0)
59 .roughness(1.0)
60 .specular(1.0),
61 )
62 .opacity(0.5)
63 .build()
64 .plot();
65}Sourcepub fn roughness(self, value: f64) -> Self
pub fn roughness(self, value: f64) -> Self
Sets the roughness of the material.
§Arguments
value– Af64value in the range 0.0 – 1.0 that controls highlight width (0.0 = glossy, 1.0 = matte).
Examples found in repository?
examples/mesh3d.rs (line 160)
123fn example_with_lighting() {
124 // Create a simple wavy surface mesh without explicit indices
125 // The mesh will be auto-triangulated
126 let mut x = Vec::new();
127 let mut y = Vec::new();
128 let mut z = Vec::new();
129
130 let n = 20;
131 for i in 0..n {
132 for j in 0..n {
133 let xi = (i as f64 / (n - 1) as f64) * 2.0 - 1.0;
134 let yj = (j as f64 / (n - 1) as f64) * 2.0 - 1.0;
135 x.push(xi);
136 y.push(yj);
137 // Create a wavy surface
138 z.push(0.3 * ((xi * 3.0).sin() + (yj * 3.0).cos()));
139 }
140 }
141
142 let dataset = DataFrame::new(vec![
143 Column::new("x".into(), x),
144 Column::new("y".into(), y),
145 Column::new("z".into(), z),
146 ])
147 .unwrap();
148
149 Mesh3D::builder()
150 .data(&dataset)
151 .x("x")
152 .y("y")
153 .z("z")
154 .color(Rgb(200, 200, 255))
155 .lighting(
156 &Lighting::new()
157 .ambient(0.5)
158 .diffuse(0.8)
159 .specular(0.5)
160 .roughness(0.2)
161 .fresnel(0.2),
162 )
163 .light_position((1, 1, 2))
164 .opacity(1.0)
165 .flat_shading(false)
166 .contour(true)
167 .plot_title(
168 Text::from("Wavy Surface with Custom Lighting")
169 .font("Arial")
170 .size(22),
171 )
172 .build()
173 .plot();
174}More examples
examples/surfaceplot.rs (line 59)
8fn main() {
9 let n: usize = 100;
10 let (x_base, _): (Vec<f64>, Option<usize>) =
11 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
12 let (y_base, _): (Vec<f64>, Option<usize>) =
13 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
14
15 let x = x_base
16 .iter()
17 .flat_map(|&xi| iter::repeat_n(xi, n))
18 .collect::<Vec<_>>();
19
20 let y = y_base
21 .iter()
22 .cycle()
23 .take(n * n)
24 .cloned()
25 .collect::<Vec<_>>();
26
27 let z = x_base
28 .iter()
29 .flat_map(|i| {
30 y_base
31 .iter()
32 .map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
33 .collect::<Vec<_>>()
34 })
35 .collect::<Vec<_>>();
36
37 let dataset = df![
38 "x" => &x,
39 "y" => &y,
40 "z" => &z,
41 ]
42 .unwrap();
43
44 SurfacePlot::builder()
45 .data(&dataset)
46 .x("x")
47 .y("y")
48 .z("z")
49 .plot_title(Text::from("Surface Plot").font("Arial").size(18))
50 .color_bar(&ColorBar::new().border_width(1))
51 .color_scale(Palette::Cividis)
52 .reverse_scale(true)
53 .lighting(
54 &Lighting::new()
55 .position(1, 0, 0)
56 .ambient(1.0)
57 .diffuse(1.0)
58 .fresnel(1.0)
59 .roughness(1.0)
60 .specular(1.0),
61 )
62 .opacity(0.5)
63 .build()
64 .plot();
65}Sourcepub fn specular(self, value: f64) -> Self
pub fn specular(self, value: f64) -> Self
Sets the specular highlight intensity.
§Arguments
value– Af64value in the range 0.0 – 1.0 specifying the mirror‑like highlight strength.
Examples found in repository?
examples/mesh3d.rs (line 159)
123fn example_with_lighting() {
124 // Create a simple wavy surface mesh without explicit indices
125 // The mesh will be auto-triangulated
126 let mut x = Vec::new();
127 let mut y = Vec::new();
128 let mut z = Vec::new();
129
130 let n = 20;
131 for i in 0..n {
132 for j in 0..n {
133 let xi = (i as f64 / (n - 1) as f64) * 2.0 - 1.0;
134 let yj = (j as f64 / (n - 1) as f64) * 2.0 - 1.0;
135 x.push(xi);
136 y.push(yj);
137 // Create a wavy surface
138 z.push(0.3 * ((xi * 3.0).sin() + (yj * 3.0).cos()));
139 }
140 }
141
142 let dataset = DataFrame::new(vec![
143 Column::new("x".into(), x),
144 Column::new("y".into(), y),
145 Column::new("z".into(), z),
146 ])
147 .unwrap();
148
149 Mesh3D::builder()
150 .data(&dataset)
151 .x("x")
152 .y("y")
153 .z("z")
154 .color(Rgb(200, 200, 255))
155 .lighting(
156 &Lighting::new()
157 .ambient(0.5)
158 .diffuse(0.8)
159 .specular(0.5)
160 .roughness(0.2)
161 .fresnel(0.2),
162 )
163 .light_position((1, 1, 2))
164 .opacity(1.0)
165 .flat_shading(false)
166 .contour(true)
167 .plot_title(
168 Text::from("Wavy Surface with Custom Lighting")
169 .font("Arial")
170 .size(22),
171 )
172 .build()
173 .plot();
174}More examples
examples/surfaceplot.rs (line 60)
8fn main() {
9 let n: usize = 100;
10 let (x_base, _): (Vec<f64>, Option<usize>) =
11 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
12 let (y_base, _): (Vec<f64>, Option<usize>) =
13 Array::linspace(-10., 10., n).into_raw_vec_and_offset();
14
15 let x = x_base
16 .iter()
17 .flat_map(|&xi| iter::repeat_n(xi, n))
18 .collect::<Vec<_>>();
19
20 let y = y_base
21 .iter()
22 .cycle()
23 .take(n * n)
24 .cloned()
25 .collect::<Vec<_>>();
26
27 let z = x_base
28 .iter()
29 .flat_map(|i| {
30 y_base
31 .iter()
32 .map(|j| 1.0 / (j * j + 5.0) * j.sin() + 1.0 / (i * i + 5.0) * i.cos())
33 .collect::<Vec<_>>()
34 })
35 .collect::<Vec<_>>();
36
37 let dataset = df![
38 "x" => &x,
39 "y" => &y,
40 "z" => &z,
41 ]
42 .unwrap();
43
44 SurfacePlot::builder()
45 .data(&dataset)
46 .x("x")
47 .y("y")
48 .z("z")
49 .plot_title(Text::from("Surface Plot").font("Arial").size(18))
50 .color_bar(&ColorBar::new().border_width(1))
51 .color_scale(Palette::Cividis)
52 .reverse_scale(true)
53 .lighting(
54 &Lighting::new()
55 .position(1, 0, 0)
56 .ambient(1.0)
57 .diffuse(1.0)
58 .fresnel(1.0)
59 .roughness(1.0)
60 .specular(1.0),
61 )
62 .opacity(0.5)
63 .build()
64 .plot();
65}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lighting
impl RefUnwindSafe for Lighting
impl Send for Lighting
impl Sync for Lighting
impl Unpin for Lighting
impl UnwindSafe for Lighting
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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().