• Home
  • Raw
  • Download

Lines Matching +full:rust +full:- +full:src

1 # Plotters - A Rust drawing library focus on data plotting for both WASM and native applications  �…
4 <img style="display: inline!important" src="https://img.shields.io/crates/v/plotters.svg"></img>
7 <img style="display: inline!important" src="https://docs.rs/plotters/badge.svg"></img>
9 <a href="https://plotters-rs.github.io/rustdoc/plotters/">
10 …<img style="display: inline! important" src="https://img.shields.io/badge/docs-development-lightgr…
12 <a href="https://travis-ci.org/38/plotters">
13 …<img style="display: inline! important" src="https://travis-ci.org/38/plotters.svg?branch=master">…
16 …<img style="display: inline! important" src="https://codecov.io/gh/38/plotters/branch/master/graph…
19 …ed for rendering figures, plots, and charts, in pure rust. Plotters supports various types of back
22 - A new Plotters Developer's Guide is working in progress. The preview version is available at [her…
23 - To try Plotters with interactive Jupyter notebook, or view [here](https://plotters-rs.github.io/p…
24 - To view the WASM example, go to this [link](https://plumberserver.com/plotters-wasm-demo/index.ht…
25 - Currently we have all the internal code ready for console plotting, but a console based backend i…
32 …<img src="https://plotters-rs.github.io/plotters-doc-data/sample.png" class="galleryItem" width=20…
36 …<img src="https://plotters-rs.github.io/plotters-doc-data/stock.png" class="galleryItem" width=200…
40 …<img src="https://plotters-rs.github.io/plotters-doc-data/histogram.png" class="galleryItem" width…
43 <a href="https://github.com/38/plotters#quick-start">
44 …<img src="https://plotters-rs.github.io/plotters-doc-data/0.png" class="galleryItem" width=200px><…
48 …<img src="https://plotters-rs.github.io/plotters-doc-data/console-2.png" class="galleryItem" width…
52 …<img src="https://plotters-rs.github.io/plotters-doc-data/mandelbrot.png" class="galleryItem" widt…
55 <a href="https://github.com/38/plotters#trying-with-jupyter-evcxr-kernel-interactively">
56 …<img src="https://plotters-rs.github.io/plotters-doc-data/evcxr_animation.gif" class="galleryItem"…
60 <a href="https://github.com/38/plotters/tree/master/examples/piston-demo">
61 …<img src="https://plotters-rs.github.io/plotters-doc-data/plotters-piston.gif" class="galleryItem"…
64 <a href="https://github.com/38/plotters/blob/master/examples/normal-dist.rs">
65 …<img src="https://plotters-rs.github.io/plotters-doc-data/normal-dist.png" class="galleryItem" wid…
68 <a href="https://github.com/38/plotters/blob/master/examples/two-scales.rs">
69 …<img src="https://plotters-rs.github.io/plotters-doc-data/twoscale.png" class="galleryItem" width=…
73 …<img src="https://plotters-rs.github.io/plotters-doc-data/matshow.png" class="galleryItem" width=2…
77 …<img src="https://plotters-rs.github.io/plotters-doc-data/sierpinski.png" class="galleryItem" widt…
80 <a href="https://github.com/38/plotters/blob/master/examples/normal-dist2.rs">
81 …<img src="https://plotters-rs.github.io/plotters-doc-data/normal-dist2.png" class="galleryItem" wi…
85 …<img src="https://plotters-rs.github.io/plotters-doc-data/errorbar.png" class="galleryItem" width=…
88 <a href="https://github.com/38/plotters/blob/master/examples/slc-temp.rs">
89 …<img src="https://plotters-rs.github.io/plotters-doc-data/slc-temp.png" class="galleryItem" width=…
92 <a href="https://github.com/38/plotters/blob/master/examples/area-chart.rs">
93 …<img src="https://plotters-rs.github.io/plotters-doc-data/area-chart.png" class="galleryItem" widt…
97 …<img src="https://plotters-rs.github.io/plotters-doc-data/snowflake.png" class="galleryItem" width…
101 …<img src="https://plotters-rs.github.io/plotters-doc-data/animation.gif" class="galleryItem" width…
105 …<img src="https://plotters-rs.github.io/plotters-doc-data/console-example.png" class="galleryItem"…
109 …<img src="https://plotters-rs.github.io/plotters-doc-data/console.png" class="galleryItem" width=2…
112 <a href="https://github.com/38/plotters/blob/master/examples/blit-bitmap.rs">
113 …<img src="https://plotters-rs.github.io/plotters-doc-data/blit-bitmap.png" class="galleryItem" wid…
117 …<img src="https://plotters-rs.github.io/plotters-doc-data/boxplot.svg" class="galleryItem" width=2…
120 <a href="https://github.com/38/plotters/blob/master/examples/3d-plot.rs">
121 …<img src="https://plotters-rs.github.io/plotters-doc-data/3d-plot.svg" class="galleryItem" width=2…
127 * [Quick Start](#quick-start)
128 …* [Trying with Jupyter evcxr Kernel Interactively](#trying-with-jupyter-evcxr-kernel-interactively)
129 * [Interactive Tutorial with Jupyter Notebook](#interactive-tutorial-with-jupyter-notebook)
130 * [Plotting in Rust](#plotting-in-rust)
131 * [Plotting on HTML5 canvas with WASM Backend](#plotting-on-html5-canvas-with-wasm-backend)
132 * [What types of figure are supported?](#what-types-of-figure-are-supported)
133 * [Concepts by examples](#concepts-by-examples)
134 + [Drawing Back-ends](#drawing-backends)
135 + [Drawing Area](#drawing-area)
137 + [Composable Elements](#composable-elements)
138 + [Chart Context](#chart-context)
140 + [Development Version](#development-version)
141 …cing Depending Libraries && Turning Off Backends](#reducing-depending-libraries--turning-off-backe…
142 + [List of Features](#list-of-features)
143 * [FAQ List](#faq-list)
153 And the following code draws a quadratic function. `src/main.rs`,
155 ```rust
157 fn main() -> Result<(), Box<dyn std::error::Error>> {
158 let root = BitMapBackend::new("plotters-doc-data/0.png", (640, 480)).into_drawing_area();
161 .caption("y=x^2", ("sans-serif", 50).into_font())
165 .build_ranged(-1f32..1f32, -0.1f32..1f32)?;
171 (-50..=50).map(|x| x as f32 / 50.0).map(|x| (x, x * x)),
187 ![](https://plotters-rs.github.io/plotters-doc-data/0.png)
209 .build_ranged(-1f32..1f32, -0.1f32..1f32)?;
214 (-50..=50).map(|x| x as f32 / 50.0).map(|x| (x, x * x)),
229 <img src="https://plotters-rs.github.io/plotters-doc-data/evcxr_animation.gif" width="450px"></img>
242 git clone https://github.com/38/plotters-doc-data
243 cd plotteres-doc-data
247 And select the notebook called `evcxr-jupyter-integration.ipynb`.
249 …vailable at the [this location](https://plumberserver.com/plotters-docs/evcxr-jupyter-integration.…
251 ## Plotting in Rust
253 Rust is a perfect language for data visualization. Although there are many mature visualization lib…
254 But Rust is one of the best languages fits the need.
256 * **Easy to use** Rust has a very good iterator system built into the standard library. With the he…
257 Plotting in Rust can be as easy as most of the high-level programming languages. The Rust based plo…
261 Rust is a good choice. Rust's performance allows you to combine data processing step
262 and rendering step into a single application. When plotting in high-level programming languages,
263 e.g. Javascript or Python, data points must be down-sampled before feeding into the plotting
264 program because of the performance considerations. Rust is fast enough to do the data processing an…
266 … rendering code into your application handling a huge amount of data and visualize it in real-time.
268 * **WebAssembly Support** Rust is one of few the language with the best WASM support. Plotting in R…
276 There's a small demo for Plotters + WASM under `examples/wasm-demo` directory of this repo.
277 To play with the deployed version, follow this [link](https://plumberserver.com/plotters-wasm-demo/…
292 ### Drawing Back-ends
293 Plotters can use different drawing back-ends, including SVG, BitMap, and even real-time rendering. …
295 ```rust
297 fn main() -> Result<(), Box<dyn std::error::Error>> {
299 let mut backend = BitMapBackend::new("plotters-doc-data/1.png", (300, 200));
307 ![](https://plotters-rs.github.io/plotters-doc-data/1.png)
312 This is done by creating sub-drawing-areas.
316 ```rust
318 fn main() -> Result<(), Box<dyn std::error::Error>> {
320 BitMapBackend::new("plotters-doc-data/2.png", (300, 200)).into_drawing_area();
331 ![](https://plotters-rs.github.io/plotters-doc-data/2.png)
336 There are different types of built-in elements, like lines, texts, circles, etc.
343 ```rust
345 fn main() -> Result<(), Box<dyn std::error::Error>> {
346 let root = BitMapBackend::new("plotters-doc-data/3.png", (300, 200)).into_drawing_area();
358 ![](https://plotters-rs.github.io/plotters-doc-data/3.png)
362 Besides the built-in elements, elements can be composed into a logic group we called composed eleme…
363 When composing new elements, the upper-left corner is given in the target coordinate, and a new pix…
364 coordinate which has the upper-left corner defined as `(0,0)` is used for further element compositi…
368 ```rust
372 fn main() -> Result<(), Box<dyn std::error::Error>> {
373 let root = BitMapBackend::new("plotters-doc-data/4.png", (640, 480)).into_drawing_area();
389 ("sans-serif", 15.0).into_font(),
400 ![](https://plotters-rs.github.io/plotters-doc-data/4.png)
409 ```rust
411 fn main() -> Result<(), Box<dyn std::error::Error>> {
412 let root = BitMapBackend::new("plotters-doc-data/5.png", (640, 480)).into_drawing_area();
418 .caption("This is our first plot", ("sans-serif", 40).into_font())
446 return EmptyElement::at(c) // We want to construct a composed element on-the-fly
448 + Text::new(format!("{:?}", c), (10, 0), ("sans-serif", 10).into_font());
455 ![](https://plotters-rs.github.io/plotters-doc-data/5.png)
470 use `default_features = false` in the dependency description in `Cargo.toml` and you can cherry-pic…
472 - `svg` Enable the `SVGBackend`
473 - `bitmap` Enable the `BitMapBackend`
489 and then you should be able to cherry-pick what features you want to include into `Plotters` crate.
494 - Tier 1 drawing backends
497 |---------|--------------|--------|------------|
498 | bitmap\_encoder | Allow `BitMapBackend` save the result to bitmap files | image, rusttype, font-
500 | bitmap\_gif| Opt-in GIF animation Rendering support for `BitMapBackend`, implies `bitmap` enabled…
502 - Font manipulation features
505 |---------|--------------|--------|------------|
506 | ttf | Allows TrueType font support | rusttype, font-kit | Yes |
508 - Coordinate features
511 |---------|--------------|--------|------------|
514 - Element, series and util functions
517 |---------|--------------|--------|------------|
526 - Misc
529 |---------|--------------|--------|------------|
539 …which in most of the case is any of the x86 target. Thus you need add `--target=wasm32-unknown-unk…