[−][src]Crate preexplorer
Save data and have a glance at it with quick plots. Leave the detailed plotting to other interactive tools like gnuplot.
Do you have a costly process in Rust and want to save the data for postprocessing? Would you like to still have a basic glance to check it and leave fine-tuning of the plot for later? This is the crate for you!
Philosophy
Rust is great at computing, making the perfect plot takes times and repetition. This repetitive process in search of the perfect plot should be done externally, and does not need Rust computing power. Therefore, once you achieve the data in Rust, save it, have a quick glance, and leave a simple gnuplot-script to start the fine tunning of your perfect plot.
Remarks
All data will be saved under the folder "target\preexplorer\data" in the main directory. Plot scripts are saved under the foleder "target\preexplorer\plots".
Recall that you will need to install gnuplot to use the crate at its full potential.
Examples
Quickly check your results.
use preexplorer::prelude::*; (0..100).map(|i| i * i) .preexplore() .set_title("My computations") .plot("my_identifier") .unwrap();
Check numerical simulations.
use preexplorer::prelude::*; use rand_distr::Exp1; use rand::prelude::*; let simulation_results: Vec<f64> = (0..100).map(|_| thread_rng().sample(Exp1)).collect(); pre::Density::new(simulation_results) .set_title("Empirical Exponential 1") .plot("my_identifier") .unwrap();
Save some data (mostly numerical: matrices, simulation results and related errors, etc).
use preexplorer::prelude::*; let my_data = vec![0., 1.1, 0.001, 2., 2.3, 0.01, 3., 1.7, 0.02]; // Some data let dimension = 2; pre::Data::new(my_data, dimension) .set_title("My title") .plot_later("my_identifier") .unwrap();
Plot some function in a grid.
use preexplorer::prelude::*; use ndarray::Array; let grid = Array::linspace(0., 1., 20); let values = grid.iter().map(|x| x * x); (grid.iter(), values).preexplore() .set_title("My title") .plot("my_identifier") .unwrap();
Modules
errors | Errors wrapper from writting data. Errors from the crate. |
prelude | All you ussually need. Easily start preexploring you results. |
Structs
Configuration | Configuration for all basic options included. |
Data | Generic multi-dimensional data. |
Densities | Comparison counter part of |
Density | Akin to a histogram: point cloud, density and cummulative distribution. |
Process | Indexed sequence of values. |
Processes | Comparison counter part of |
Sequence | Sequence of values. |
Sequences | Comparison counter part of |
Constants
DATA_DIR | |
PLOT_DIR |
Traits
Configurable | Allows basic saving and plotting configuration. |
Plotable | Allows quick plotting. |
Preexplore | Quickly transform interators in |
PreexploreProcess | Quickly transform tuples of interators in |
Saveable | Allows quick saving. |