Skip to content
Snippets Groups Projects
Commit b3449155 authored by STEVAN Antoine's avatar STEVAN Antoine 🦀
Browse files

add support for _custom style_ in `plot.py` (!90)

> 💡 **Note**  
> - in the following examples, any part of the `$.style` specification is optional and can either be ommitted or set to `null`
> - the default values for `$.style` are given in `plot.py --help`

```rust
let xs = seq 0 5 | each { 2 ** $in } | wrap x
let twice = $xs | insert measurement { 2 * $in.x } | insert error { 0.1 + 0.5 * $in.x }
let square = $xs | insert measurement { $in.x ** 2 } | insert error { 1 + 1.5 * $in.x }
```
and try
```rust
python scripts/plot/plot.py --title title --x-label x --y-label y --fullscreen ([
    { group: "x ^ 2", items: $square },
    { group: "2 * x", items: $twice }
] | to json)
```
vs
```rust
python scripts/plot/plot.py --title title --x-label x --y-label y --fullscreen ([
    {
        group: "x ^ 2",
        items: $square,
        style: {
            color: "red",
            alpha: 0.5,
            line: {
                marker: 's',
                width: 2,
                type: "dashed",
            },
        }
    },
    {
        group: "2 * x",
        items: $twice,
        style: {
            color: "purple",
            alpha: 0.1,
            line: {
                marker: 'o',
                width: 5,
                type: "dotted",
            },
        }
    }
] | to json)
```
parent 72f3cd8a
No related branches found
No related tags found
1 merge request!90add support for _custom style_ in `plot.py`
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment