Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom derive #4

Open
ubnt-intrepid opened this issue Apr 9, 2017 · 0 comments
Open

custom derive #4

ubnt-intrepid opened this issue Apr 9, 2017 · 0 comments

Comments

@ubnt-intrepid
Copy link
Owner

#[derive(Matplotlib)]
#[mpl(title="Sine curve", xlabel="Time[sec]", legend="upper right")]
struct PlotData {
  #[mpl(xaxis)]
  xdata: Vec<f64>,
  #[mpl(yaxis(label="sin(x)"))]
  ydata1: Vec<f64>,
  #[mpl(yaxis(label="cos(x)"))]
  ydata2: Vec<f64>,
}

fn main() {
  let plot_data = PlotData::new();
  let fig = plot_data.to_fig();
  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant