Skip to content

custom derive #4

@ubnt-intrepid

Description

@ubnt-intrepid
#[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();
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions