summaryrefslogtreecommitdiff
path: root/src/plot/gnuplot.rs
diff options
context:
space:
mode:
authornatrixaeria <upezu@student.kit.edu>2019-12-13 01:40:50 +0100
committernatrixaeria <upezu@student.kit.edu>2019-12-13 01:40:50 +0100
commit1daf4f35a5dd2f500d95541797661c518f4e2713 (patch)
tree8eaa050dccfcc68cb1a469060f08fe17f86800f2 /src/plot/gnuplot.rs
parent5af75f14af3758a37edaee08f1a49a12f89b48e0 (diff)
Replace vectors with slices for plotting data
Diffstat (limited to 'src/plot/gnuplot.rs')
-rw-r--r--src/plot/gnuplot.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plot/gnuplot.rs b/src/plot/gnuplot.rs
index b0d63d8..ea52a18 100644
--- a/src/plot/gnuplot.rs
+++ b/src/plot/gnuplot.rs
@@ -8,7 +8,7 @@ pub struct Gnuplot;
impl Gnuplot {
fn exec_plot(
- data: Vec<[f64; 6]>,
+ data: &[[f64; 6]],
chunk_size: u32,
start: usize,
end: usize,
@@ -43,27 +43,27 @@ impl Gnuplot {
}
impl super::Graph for Gnuplot {
- fn plot3d(data: Vec<[f64; 6]>, chunk_size: u32) {
+ fn plot3d(data: &[[f64; 6]], chunk_size: u32) {
let iterations = data.len() / chunk_size as usize;
match Gnuplot::exec_plot(data, chunk_size, 1, iterations, "anim3d.plt") {
Ok(mut process) => println!("opening gnuplot {:?}", process.wait()),
Err(err) => println!("failed to start gnuplot: {}", err),
}
}
- fn animate3d(data: Vec<[f64; 6]>, chunk_size: u32, start: usize, end: usize) {
+ fn animate3d(data: &[[f64; 6]], chunk_size: u32, start: usize, end: usize) {
match Gnuplot::exec_plot(data, chunk_size, start, end, "anim3d.plt") {
Ok(mut process) => println!("opening gnuplot {:?}", process.wait()),
Err(err) => println!("failed to start gnuplot: {}", err),
}
}
- fn plot2d(data: Vec<[f64; 6]>, chunk_size: u32) {
+ fn plot2d(data: &[[f64; 6]], chunk_size: u32) {
let iterations = data.len() / chunk_size as usize;
match Gnuplot::exec_plot(data, chunk_size, 1, iterations, "anim2d.plt") {
Ok(mut process) => println!("opening gnuplot {:?}", process.wait()),
Err(err) => println!("failed to start gnuplot: {}", err),
}
}
- fn animate2d(data: Vec<[f64; 6]>, chunk_size: u32, start: usize, end: usize) {
+ fn animate2d(data: &[[f64; 6]], chunk_size: u32, start: usize, end: usize) {
match Gnuplot::exec_plot(data, chunk_size, start, end, "anim2d.plt") {
Ok(mut process) => println!("opening gnuplot {:?}", process.wait()),
Err(err) => println!("failed to start gnuplot: {}", err),