gnuplot_wrapper/commands/
set.rsuse crate::{command::Command, script::Script};
pub struct Set {
value: String,
}
impl Set {
pub fn new(str: &str) -> Self {
return Set {
value: str.to_string(),
};
}
}
impl Command for Set {
fn to_raw(&self) -> String {
return format!("set {}", self.value);
}
}
impl Script {
pub fn set(&mut self, str: &str) {
self.add_command(Set::new(str));
}
pub fn set_grid(&mut self) {
self.add_command(Set::new("grid"));
}
pub fn set_logscale(&mut self, axes: &str) {
self.add_command(Set::new(&format!("logscale {}", axes)));
}
}