help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Graphing a list of values


From: hancooper
Subject: Graphing a list of values
Date: Sat, 18 Sep 2021 05:46:01 +0000

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, September 18, 2021 5:26 AM, Alex fxmbsw7 Ratchev 
<fxmbsw7@gmail.com> wrote:

> you have a max_mb per maxcols too ?
>
> i wanted to give it a try but the max_mb is missing, for scaling right
>
> .. ?

I can set a maximum (7200 is a sensible value), or use the maximum in the array.

> On Sat, Sep 18, 2021, 06:09 hancooper via help-bash@gnu.org wrote:
>
> > I have an array composed of the following elements and want to generate a
> > graph of the values, distributed over a number of columns (ncols=80)
> >
> >     + 3665.64686592 MB
> >     + 1261.64520768 MB
> >     + 96.35131584 MB
> >     + 61.17171840 MB
> >     + 99.81615072 MB
> >     + 541.22517696 MB
> >     + 1067.42695488 MB
> >     + 462.11600448 MB
> >     + 970.72017120 MB
> >     + 1539.70699584 MB
> >     + 2207.06856864 MB
> >     + 2522.07166848 MB
> >     + 645.12725472 MB
> >     + 104.71848192 MB
> >     + 70.59747552 MB
> >     + 44.05066848 MB
> >
> >
> > For instance
> >
> >     + 10 MB
> >     + 50 MB
> >     + 100 MB
> >
> >
> > Here would be the result with `ncols=10`
> >
> >     *
> >     *****
> >     **********
> >
> >
> > Have started with the following, but have to modify to take values from an
> > array. Using `awk` seems as the better way to do this.
> >
> >     oaggr=("+ 659.28737472 MB" "+ 316.94840736 MB" "+ 163.69489344 MB")
> >     awk '{$2=sprintf("%-*s", $2, ""); gsub(" ", "=", $2); \\
> >     printf("%-10s%s\\n", $1, $2)}' file
> >





reply via email to

[Prev in Thread] Current Thread [Next in Thread]