11/*!
22
3- Data structures and helpers for managing plotting data
3+ # plotlib
4+
5+ plotlib is a data plotting and rendering library/
6+
7+ ## Technical
48
59Five main components of the plotlib pipeline:
610
@@ -10,11 +14,11 @@ Five main components of the plotlib pipeline:
10144. Plot
11155. Rendering
1216
13- *Data* is the plain Rust data structure that the user brings along.
17+ ** Data* * is the plain Rust data structure that the user brings along.
1418This might be something like a `Vec`, an `ndarray` or a slice.
1519This will likely be copied or moved from to contruct the *representation*.
1620
17- The *representation* is the transformed version of that data which is the base plot object.
21+ The ** representation* * is the transformed version of that data which is the base plot object.
1822Each representation has N dimensions of input and one dimension of output.
1923For example a scatter plot has x-values as inputs and for each of those a y-value as an output.
2024A histogram has bins along one axis as its input and counts (or frequencies) as its output.
@@ -27,14 +31,14 @@ A concrete interpretation of this style is deferred to when the rendering happen
2731So a scatter plot will know what colour and style to use for the markers,
2832and a histogram will know which colours to use for its bars.
2933
30- The *view* is how you want this data to be presented.
34+ The ** view* * is how you want this data to be presented.
3135Each dimension from the representation is mapped onto an axis.
3236A view can contain multiple representations as long as they can be mapped on to the axes.
3337For example a 2D 'matrix' histogram could be displayed as a flat grid or as a 3D LEGO plot.
3438
35- A *plot* is the whole 'page'. It can contain multiple views and specifies how they are laid out.
39+ A ** plot* * is the whole 'page'. It can contain multiple views and specifies how they are laid out.
3640
37- Finally the rendering is the actual output.
41+ Finally the ** rendering** is the actual output.
3842This could be an SVG, a PNG, an ASCII plot or an interactive web page.
3943A rendering will not necessarilly be able to show all types of views or representations
4044and may choose to ignore some.
@@ -44,17 +48,17 @@ or for a particular representation to be displayed across more than one view.
4448
4549Example
4650
47- Data: A linear sequence of numbers as a Vec<f64>
48- Representation: A binned histogram, stored as a list of `Bin`s,
51+ - * Data* : A linear sequence of numbers as a Vec<f64>
52+ - * Representation* : A binned histogram, stored as a list of `Bin`s,
4953 each of which is the bounds and the counts.
5054 Blue bars with no casing.
51- View: Dimension 0 mapped to x-axis with range 5-19 and counts mapped to y-axis with range 0-60
52- Plot: A single view on the page
53- Rendering: An SVG
55+ - * View* : Dimension 0 mapped to x-axis with range 5-19 and counts mapped to y-axis with range 0-60
56+ - * Plot* : A single view on the page
57+ - * Rendering* : An SVG
5458
5559It starts from the end and works backwards.
5660The Rendering (an SVG in this case) knows how to layout a *plot*.
57- It finds a single View inside and so creates teh axes for it.
61+ It finds a single view inside and so creates the axes for it.
5862It knows how to draw the axes for the view.
5963It also knows how to draw each representation onto that view,
6064in this case, interpreting the bins and colours to create SVG elements.
@@ -63,13 +67,13 @@ in this case, interpreting the bins and colours to create SVG elements.
6367
6468extern crate svg;
6569
66- pub mod representation;
70+ mod representation;
6771pub mod view;
6872pub mod plot;
6973
7074pub mod histogram;
7175pub mod scatter;
72- pub mod axis;
73- pub mod utils;
74- pub mod text_render;
75- pub mod svg_render;
76+ mod axis;
77+ mod utils;
78+ mod text_render;
79+ mod svg_render;
0 commit comments