Skip to content

Commit ccbf9b3

Browse files
committed
Sync readme.template.md with README.md
Signed-off-by: Aaron Erhardt <aaron.erhardt@t-online.de>
1 parent c202b9c commit ccbf9b3

File tree

14 files changed

+44
-48
lines changed

14 files changed

+44
-48
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ To view the source code for each example, please click on the example image.
163163
To use Plotters, you can simply add Plotters into your `Cargo.toml`
164164
```toml
165165
[dependencies]
166-
plotters = "0.3.1"
166+
plotters = "0.3.3"
167167
```
168168

169169
And the following code draws a quadratic function. `src/main.rs`,

doc-template/readme.template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ To learn how to use Plotters in different scenarios by checking out the followin
5858

5959
- WebAssembly + Plotters: [plotters-wasm-demo](https://github.com/plotters-rs/plotters-wasm-demo)
6060
- minifb + Plotters: [plotters-minifb-demo](https://github.com/plotters-rs/plotters-minifb-demo)
61-
- GTK + Plotters: [plotters-gtk-demo](https://github.com/plotters/plotters-gtk-demo)
61+
- GTK + Plotters: [plotters-gtk-demo](https://github.com/plotters-rs/plotters-gtk-demo)
6262

6363

6464
## Trying with Jupyter evcxr Kernel Interactively
@@ -74,7 +74,7 @@ extern crate plotters;
7474
use plotters::prelude::*;
7575
7676
let figure = evcxr_figure((640, 480), |root| {
77-
root.fill(&WHITE);
77+
root.fill(&WHITE)?;
7878
let mut chart = ChartBuilder::on(&root)
7979
.caption("y=x^2", ("Arial", 50).into_font())
8080
.margin(5)

doc-template/rustdoc/gallery

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</a>
7373
<div class="galleryText">
7474
Real-time Rendering
75-
<a href="https://github.com/plotters-rs/plotters-piston/blob/master/plotters/examples/cpustat.rs">[code]</a>
75+
<a href="https://github.com/plotters-rs/plotters-piston/blob/master/examples/cpustat.rs">[code]</a>
7676
</div>
7777
</div>
7878

plotters-backend/src/rasterizer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// the question mark operator has a huge performance impact due to LLVM unable to handle it.
1111
// So the question is if this trick is still useful, or LLVM is smart enough to handle it since
1212
// then.
13-
//
13+
//
1414
// --
1515
// Original comment:
1616
//

plotters-svg/src/svg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use plotters_backend::{
88
FontStyle, FontTransform,
99
};
1010

11+
use std::fmt::Write as _;
1112
use std::fs::File;
1213
#[allow(unused_imports)]
1314
use std::io::Cursor;
1415
use std::io::{BufWriter, Error, Write};
1516
use std::path::Path;
16-
use std::fmt::Write as _;
1717

1818
fn make_svg_color(color: BackendColor) -> String {
1919
let (r, g, b) = color.rgb;

plotters/src/chart/context/cartesian2d/draw_impl.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ impl<'a, DB: DrawingBackend, X: Ranged, Y: Ranged> ChartContext<'a, DB, Cartesia
119119
y1 = axis_range.end;
120120
}
121121

122-
area.draw(&PathElement::new(
123-
vec![(x0, y0), (x1, y1)],
124-
*axis_style,
125-
))?;
122+
area.draw(&PathElement::new(vec![(x0, y0), (x1, y1)], *axis_style))?;
126123
}
127124

128125
Ok(axis_range)

plotters/src/chart/series.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,7 @@ impl<'a, 'b, DB: DrawingBackend + 'a, CT: CoordTranslate> SeriesLabelStyle<'a, '
250250
continue;
251251
}
252252

253-
funcs.push(
254-
draw_func.unwrap_or(&|p: BackendCoord| EmptyElement::at(p).into_dyn()),
255-
);
253+
funcs.push(draw_func.unwrap_or(&|p: BackendCoord| EmptyElement::at(p).into_dyn()));
256254
label_element.push_line(label_text);
257255
}
258256

plotters/src/drawing/area.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Rect {
8787
.map(|(a, b)| (*a, *b))
8888
.collect();
8989

90-
// Justify: this is actually needed. Because we need to return a iterator that have
90+
// Justify: this is actually needed. Because we need to return a iterator that have
9191
// static life time, thus we need to copy the value to a buffer and then turn the buffer
9292
// into a iterator.
9393
#[allow(clippy::needless_collect)]
@@ -97,14 +97,12 @@ impl Rect {
9797
.map(|(a, b)| (*a, *b))
9898
.collect();
9999

100-
ysegs
101-
.into_iter()
102-
.flat_map(move |(y0, y1)| {
103-
xsegs
104-
.clone()
105-
.into_iter()
106-
.map(move |(x0, x1)| Self { x0, y0, x1, y1 })
107-
})
100+
ysegs.into_iter().flat_map(move |(y0, y1)| {
101+
xsegs
102+
.clone()
103+
.into_iter()
104+
.map(move |(x0, x1)| Self { x0, y0, x1, y1 })
105+
})
108106
}
109107

110108
/// Make the coordinate in the range of the rectangle

plotters/src/element/pie.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,14 @@ impl<'a, DB: DrawingBackend, Label: Display> Drawable<DB> for Pie<'a, (i32, i32)
109109
let radian_increment = PI / 180.0 / self.radius.sqrt() * 2.0;
110110
let mut perc_labels = Vec::new();
111111
for (index, slice) in self.sizes.iter().enumerate() {
112-
let slice_style =
113-
self.colors
114-
.get(index)
115-
.ok_or_else(|| DrawingErrorKind::FontError(Box::new(
116-
PieError::LengthMismatch,
117-
)))?;
112+
let slice_style = self
113+
.colors
114+
.get(index)
115+
.ok_or_else(|| DrawingErrorKind::FontError(Box::new(PieError::LengthMismatch)))?;
118116
let label = self
119117
.labels
120118
.get(index)
121-
.ok_or_else(|| DrawingErrorKind::FontError(Box::new(
122-
PieError::LengthMismatch,
123-
)))?;
119+
.ok_or_else(|| DrawingErrorKind::FontError(Box::new(PieError::LengthMismatch)))?;
124120
// start building wedge line against the previous edge
125121
let mut points = vec![*self.center];
126122
let ratio = slice / self.total;

plotters/src/evcxr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub fn evcxr_bitmap_figure<
5353
size: (u32, u32),
5454
draw: Draw,
5555
) -> SVGWrapper {
56-
const PIXEL_SIZE : usize = 3;
56+
const PIXEL_SIZE: usize = 3;
5757
let mut buf = Vec::new();
5858
buf.resize((size.0 as usize) * (size.1 as usize) * PIXEL_SIZE, 0);
5959
let root = BitMapBackend::with_buffer(&mut buf, size).into_drawing_area();

0 commit comments

Comments
 (0)