gnuplot_wrapper/commands/title.rs
1use crate::{command::Command, script::Script};
2
3/// http://gnuplot.info/docs_5.5/loc16470.html
4pub struct Title {
5 title: String
6}
7
8impl Title {
9 pub fn new(title: &str) -> Self {
10 return Title { title: title.to_owned() };
11 }
12}
13
14impl Command for Title {
15 fn to_raw(&self) -> String {
16 return format!("set title {}", self.title);
17 }
18}
19
20impl Script {
21 pub fn set_title(&mut self, title: &str) {
22 self.add_command(Title::new(title));
23 }
24}