Crates.io | debug_plotter |
lib.rs | debug_plotter |
version | 0.2.1 |
source | src |
created_at | 2021-11-08 09:53:06.907685 |
updated_at | 2021-11-09 08:15:16.521937 |
description | Convenient macro to quickly plot variables. |
homepage | |
repository | https://github.com/fabianboesiger/debug-plotter |
max_upload_size | |
id | 478435 |
size | 277,172 |
This crate provides a convenient macro to quickly plot variables.
In this example, we quickly want to plot the variables a
, b
, and c
.
Optionally, we can name the plot. Plots are saved as a PNG image in the
plots
directory that is created in the working directory.
fn main() {
for a in 0usize..10usize {
let b = (a as f32 / 2.0).sin() * 10.0;
let c = 5 - (a as i32);
debug_plotter::plot!(a, b, c where caption = "My Plot");
}
}
The example above generates a plot named "My Plot" and saves it to 'plots/My_Plot.png`.
For more information on how to use this crate, please take a look at the documentation or the examples.
Variables are only plotted if your code is run in debug mode.
In release mode, plot!
macros are ignored.
If you want to avoid compiling the dependencies for this crate in release mode, add --no-default-features
.
If you want to plot variables in release mode, use the feature plot-release
.