BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Flamingo · Choose chart ticks for an observed range

Produce chart-ready axis limits and labeled tick spacing from raw data.

Choose chart ticks for an observed range

A constant series collapses a chart axis; raw decimal steps make labels hard to read. Expand the domain before choosing a tick lattice. Including zero extends the data range to 0–11. A five-unit tick step covers that range through 15.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-flamingo.git
cd blyx-flamingo
blyxc native-run project.blyx -- "3,11" 1 4

API and return values

Returns [first tick, last tick, step, tick count]. The tick count can differ from the requested interval target. Invalid input returns an empty vector.

ArgumentAccepted input
samplesVector of: finite number
include_zerononnegative exact integer
intervalspositive exact integer

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
0
15
5
4
Open in the full playground →

Practice

Change samples = [0, 0], include_zero = 0.0, intervals = 2.0. Predict the result, then run the program.

Hint

Returns [first tick, last tick, step, tick count]. The tick count can differ from the requested interval target.

Worked solution

The result vector is [-0.5, 0.5, 0.5, 3]. Compare its fields with the return layout in the API section.

Find

    let samples = [3, 11];

Replace with

    let samples = [0, 0];

Find

    let include_zero = 1.0;

Replace with

    let include_zero = 0.0;

Find

    let intervals = 4.0;

Replace with

    let intervals = 2.0;

Output after the change

-0.5
0.5
0.5
3