Crate poloto

source ·
Expand description

Plot to SVG and style with CSS

You can find poloto on github and crates.io. Documentation at docs.rs

Check out the github examples. The latest graph outputs of the examples can be found in the assets folder.

Poloto provides by default 3 impls of HasDefaultTicks for the following types:

  • i128 - decimal/scientific notation ticks.
  • f64 - decimal/scientific notation ticks.
  • UnixTime - date/time

The above types have the advantage of automatically selecting reasonable tick intervals. The user can change the formatting of the ticks while still using the ticks that were selected.

However, sometimes you may want more control on the ticks, or want to use a type other than i128/f64/UnixTime. One way would be to write your own function that returns a TickDistGen. Alternatively you can use the ticks::from_iter function that just takes an iterator of ticks and returns a TickDistGen. This puts more responsibility on the user to pass a decent distribution of ticks. This should only really be used when the user knows up front the min and max values of that axis. This is typically the case for at least one of the axis, typically the x axis. See step example

Modules

Tools for assembling plots
Some impls of PlotNum and TickDistGen.
Contains the PlotNum trait and their supporting structs.
The poloto prelude.
Tools to render plots
Tools to create tick distributions.
Misc functions.

Macros

Macro to chain multiple plots together instead of calling chain repeatedly.

Functions

Start plotting!
shorthand for Header::new()