Skip to content

Commit 114f6dc

Browse files
committed
Update example in readme
1 parent e0ac322 commit 114f6dc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ For example, code like:
1616
extern crate plotlib;
1717
use plotlib::scatter::Scatter;
1818
use plotlib::scatter;
19+
use plotlib::style::{Marker, Point};
1920
use plotlib::view::View;
20-
use plotlib::plot::Plot;
21+
use plotlib::page::Page;
2122
2223
fn main() {
2324
// Scatter plots expect a list of pairs
2425
let data1 = [(-3.0, 2.3), (-1.6, 5.3), (0.3, 0.7), (4.3, -1.4), (6.4, 4.3), (8.5, 3.7)];
26+
2527
// We create our scatter plot from the data
2628
let s1 = Scatter::from_vec(&data1)
2729
.style(scatter::Style::new()
28-
.marker(scatter::Marker::Square) // setting the marker to be a square
30+
.marker(Marker::Square) // setting the marker to be a square
2931
.colour("#DD3355")); // and a custom colour
3032
3133
// We can plot multiple data sets in the same view
@@ -34,15 +36,15 @@ For example, code like:
3436
.style(scatter::Style::new() // uses the default marker
3537
.colour("#35C788")); // and a different colour
3638
37-
// The 'view' describeswhat set of data is drawn
39+
// The 'view' describes what set of data is drawn
3840
let v = View::new()
3941
.add(&s1)
4042
.add(&s2)
4143
.x_range(-5., 10.)
4244
.y_range(-2., 6.);
4345
44-
// A plot with a single view is then saved to an SVG file
45-
Plot::single(&v).save("scatter.svg");
46+
// A page with a single view is then saved to an SVG file
47+
Page::single(&v).save("scatter.svg");
4648
}
4749
4850
will produce output like:

0 commit comments

Comments
 (0)