Skip to content

Commit

Permalink
Add the bare bones of a contour function
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris00 committed Mar 3, 2024
1 parent ffbd993 commit 1a6ce38
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,29 @@ impl Axes {
}


pub fn contour<'a>(&'a mut self, ) -> Contour<'a> {
Contour {
axes: self,
options: PlotOptions::new(),
}
}

pub fn contour_fun<'a, F>(
&'a mut self,
f: F,
ab: [f64; 2],
cd: [f64; 2],
) -> ContourFun<'a, F>
where F: FnMut(f64, f64) -> f64 {
ContourFun {
axes: self,
options: PlotOptions::new(),
f, ab, cd,
n1: 100,
n2: 100,
}
}

#[must_use]
pub fn scatter<D>(&mut self, x: D, y: D) -> &mut Self
where D: AsRef<[f64]> {
Expand Down Expand Up @@ -801,6 +824,36 @@ where F: FnMut(f64) -> f64 {
}


#[must_use]
pub struct Contour<'a> {
axes: &'a Axes,
options: PlotOptions<'a>,
}

impl<'a> Contour<'a> {
set_plotoptions!();

}


#[must_use]
pub struct ContourFun<'a, F> {
axes: &'a Axes,
options: PlotOptions<'a>,
f: F,
ab: [f64; 2],
cd: [f64; 2],
n1: usize,
n2: usize,
}

impl<'a, F> ContourFun<'a, F>
where F: FnMut(f64, f64) -> f64 {
set_plotoptions!();

}


impl Line2D {
fn set_kw(&self, prop: &str, v: impl ToPyObject) {
Python::with_gil(|py| {
Expand Down

0 comments on commit 1a6ce38

Please sign in to comment.