gnuplot_wrapper/commands/
title.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/loc16470.html
pub struct Title {
    title: String
}

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

impl Command for Title {
    fn to_raw(&self) -> String {
        return format!("set title {}", self.title);
    }
}

impl Script {
    pub fn set_title(&mut self, title: &str) {
        self.add_command(Title::new(title));
    }
}