gnuplot_wrapper/commands/
plot.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::{command::Command, script::Script};

/// http://gnuplot.info/docs_5.5/loc7740.html
pub struct Plot {
    args: String
}

impl Plot {
    pub fn new(args: &str) -> Self {
        return Plot { args: args.to_owned() };
    }
}

impl Command for Plot {
    fn to_raw(&self) -> String {
        return format!("plot {}", self.args);
    }
}

impl Script {
    pub fn plot(&mut self, plot: &str) {
        self.add_command(Plot::new(plot));
    }
}