Proper interpolation of values not on exact halves.
"percentile $1 out of bounds\n"
);
my $index = $#order * $1 / 100;
- return ($order[$index] + $order[$index + .5]) / 2;
+ my $f = $index - int $index;
+ my $val = $order[$index];
+ if ($f) {
+ my $next = $order[$index + 1];
+ $val -= $f * ($val - $next);
+ }
+ return $val;
}
elsif ($func =~ /\A-?[0-9.]+\z/) {
return $func;
=item I<percentage>B<v>
-Ranked value at the given percentile.
-The default shows C<+> at C<50v> for the mean or median;
-the middle value or average between middle values.
-One standard deviation right of the mean is at about C<68.3v>.
+Ranked value at the given percentile,
+or score at or below which a percentage falls
+in its frequency distribution (inclusive).
+
+The default shows C<+> at C<50v> for the mean or median:
+the middle value or interpolation between two values.
+One standard deviation below the median is at about C<68v>.
The default includes C<< >31.73v <68.27v >>
to encompass all I<normal> results, or 68% of all entries, by I<< <--> >>.
barcat input/seq3.txt
1 -------------
-2 ------------------------+
-3 ------------------------+------>------
+2 --------------------<---+
+3 --------------------<---+---->--------
2955 ----------
3894 --------------
4794 -----------------
-5646 ------------------<-
-6442 ------------------<---=
-7174 ------------------<---=--
-7833 ------------------<---=--+-
-8415 ------------------<---=--+---
-8912 ------------------<---=--+---->
-9320 ------------------<---=--+---->--
-9636 ------------------<---=--+---->---
-9855 ------------------<---=--+---->----
-9975 ------------------<---=--+---->----
-9996 ------------------<---=--+---->----
-9917 ------------------<---=--+---->----
-9738 ------------------<---=--+---->---
-9463 ------------------<---=--+---->--
-9093 ------------------<---=--+---->-
-8632 ------------------<---=--+----
-8085 ------------------<---=--+--
-7457 ------------------<---=--+
-6755 ------------------<---=-
-5985 ------------------<--
-5155 ------------------
+5646 -----------------<--
+6442 -----------------<----=
+7174 -----------------<----=--
+7833 -----------------<----=--+-
+8415 -----------------<----=--+---
+8912 -----------------<----=--+---->
+9320 -----------------<----=--+---->--
+9636 -----------------<----=--+---->---
+9855 -----------------<----=--+---->----
+9975 -----------------<----=--+---->----
+9996 -----------------<----=--+---->----
+9917 -----------------<----=--+---->----
+9738 -----------------<----=--+---->---
+9463 -----------------<----=--+---->--
+9093 -----------------<----=--+---->-
+8632 -----------------<----=--+----
+8085 -----------------<----=--+--
+7457 -----------------<----=--+
+6755 -----------------<----=-
+5985 -----------------<---
+5155 -----------------<
4274 ---------------
3350 ------------
2392 --------
nan
-1 negative -------
-2 negativer
- 0 zero ------------=-|
- .0 zeroer ------------=-|
--00 zeroest ------------=-|
+ 0 zero -----------<=-|
+ .0 zeroer -----------<=-|
+-00 zeroest -----------<=-|
-1.5 positive ------------=-|-----------
+1.5 positive -----------<=-|-----------
barcat input/unicode.txt
-9324 A --<---+--=--->-------------------
+9324 A --<---+--=-->--------------------
920 B --<
476 C --
619 Ĉ --
2094 D --<---+
-6552 E --<---+--=--->---------
+6552 E --<---+--=-->----------
1062 F --<-
766 G --<
738 Ĝ --<
371 H -
7 Ĥ
-5513 I --<---+--=--->------
+5513 I --<---+--=-->-------
1140 J --<-
38 Ĵ
2558 K --<---+--
-4253 L --<---+--=--->-
+4253 L --<---+--=-->--
2183 M --<---+-
-6321 N --<---+--=--->--------
-8110 O --<---+--=--->---------------
+6321 N --<---+--=-->---------
+8110 O --<---+--=-->----------------
2266 P --<---+-
-4387 R --<---+--=--->--
-5462 S --<---+--=--->-----
+4387 R --<---+--=-->---
+5462 S --<---+--=-->------
331 Ŝ -
-3534 T --<---+--=---
+3534 T --<---+--=-->
2579 U --<---+--
320 Ŭ -
1458 V --<--
383 Z -
# 23731 whitespace
-4217 … --<---+--=--->-
+4217 … --<---+--=-->--
\r0
2 prepend -<
3: append -<
4 3 2 1 trailing space -<+
-010 -<+=->--
- 10. more -<+=->--
-5.0less -<+=
+010 -<+>----
+ 10. more -<+>----
+5.0less -<+>
2 prepend -<
3: append -<
4 3 2 1 trailing space -<+
-010 -<+=->--
- 10. more -<+=->--
-5.0less -<+=
+010 -<+>----
+ 10. more -<+>----
+5.0less -<+>
barcat -l0 input/aligned.txt
1 ----
2 -------
- 3:----------<
- 4 ----------<--+
-010 ----------<--+---=-------->---------
- 10.----------<--+---=-------->---------
-5.0l----------<--+---=
+ 3:---------<-
+ 4 ---------<---+
+010 ---------<---+---=->----------------
+ 10.---------<---+---=->----------------
+5.0l---------<---+---=
barcat -l1 input/aligned.txt
1 ----
2 -------
- 3: ----------<
- 4 ----------<--+
-010 ----------<--+---=------->---------
- 10. ----------<--+---=------->---------
-5.0l ----------<--+---=
+ 3: ---------<-
+ 4 ---------<---+
+010 ---------<---+---=>----------------
+ 10. ---------<---+---=>----------------
+5.0l ---------<---+---=
barcat -l5 input/aligned.txt
1 ---
2 pr… ------
- 3: … ---------<
- 4 … ---------<--+
-010 ---------<--+--=------->--------
- 10. m… ---------<--+--=------->--------
-5.0less ---------<--+--=
+ 3: … --------<-
+ 4 … --------<---+
+010 --------<---+--=->--------------
+ 10. m… --------<---+--=->--------------
+5.0less --------<---+--=
2 prepend ---
3: append ----<
4 3 2 1 trail… ----<-+
-010 ----<-+-=--->----
- 10. more ----<-+-=--->----
-5.0less ----<-+-=
+010 ----<-+->--------
+ 10. more ----<-+->--------
+5.0less ----<-+->
2 prepend -
3: append -+
4 3 2 1 trailing space -+
-010 -+=->-
- 10. more -+=->-
-5.0less -+=
+010 -+>---
+ 10. more -+>---
+5.0less -+>
2 prepend --
3: append --<
4 3 2 1 trailing space --<+
- 010 --<+=-->--
- 10. more --<+=-->--
- 5.0less --<+=
+ 010 --<+>-----
+ 10. more --<+>-----
+ 5.0less --<+>
2 pre… -------
3: … ---------<
4 ---------<--+
- 010 ---------<--+---=------->--------
- 10. … ---------<--+---=------->--------
+ 010 ---------<--+---=>---------------
+ 10. … ---------<--+---=>---------------
5.0… ---------<--+---=
100 ----------<
1000 ----------<-----+
1e4 ----------<-----+-----
-100000 ----------<-----+-------->--
- 1e6 ----------<-----+-------->--=----
+100000 ----------<-----+----->-----
+ 1e6 ----------<-----+----->-----=----
16384 2^14 ---
32768 2^15 ---
65536 2^16 ---
- 131072 2^17 ----
- 262144 2^18 ----
- 524288 2^19 ----
- 1048576 2^20 ----
- 2097152 2^21 ----<
- 4194304 2^22 ----<
- 8388608 2^23 ----<
- 16777216 2^24 ----<
- 33554432 2^25 ----<
- 67108864 2^26 ----<-
- 134217728 2^27 ----<-
- 268435456 2^28 ----<-
- 536870912 2^29 ----<-
- 1073741824 2^30 ----<-
- 2147483648 2^31 ----<-+
- 4294967296 2^32 ----<-+
- 8589934592 2^33 ----<-+
- 17179869184 2^34 ----<-+
- 34359738368 2^35 ----<-+-
- 68719476736 2^36 ----<-+-
- 137438953472 2^37 ----<-+-
- 274877906944 2^38 ----<-+-
- 549755813888 2^39 ----<-+-
- 1099511627776 2^40 ----<-+--
- 2199023255552 2^41 ----<-+--
- 4398046511104 2^42 ----<-+--
- 8796093022208 2^43 ----<-+--
- 17592186044416 2^44 ----<-+--
- 35184372088832 2^45 ----<-+-->
- 70368744177664 2^46 ----<-+-->
- 140737488355328 2^47 ----<-+-->
- 281474976710656 2^48 ----<-+-->
- 562949953421312 2^49 ----<-+-->-
- 1125899906842624 2^50 ----<-+-->-
- 2251799813685248 2^51 ----<-+-->-
- 4503599627370496 2^52 ----<-+-->-
- 9007199254740992 2^53 ----<-+-->-
- 18014398509481984 2^54 ----<-+-->--
- 36028797018963968 2^55 ----<-+-->--
- 72057594037927936 2^56 ----<-+-->--
- 144115188075855872 2^57 ----<-+-->--
- 288230376151711744 2^58 ----<-+-->--
- 576460752303423488 2^59 ----<-+-->--=
- 1152921504606846976 2^60 ----<-+-->--=
- 2305843009213693952 2^61 ----<-+-->--=
- 4611686018427387904 2^62 ----<-+-->--=
- 9223372036854775808 2^63 ----<-+-->--=-
-18446744073709551616 2^64 ----<-+-->--=-
-36893488147419103232 2^65 ----<-+-->--=-
+ 131072 2^17 ---<
+ 262144 2^18 ---<
+ 524288 2^19 ---<
+ 1048576 2^20 ---<
+ 2097152 2^21 ---<-
+ 4194304 2^22 ---<-
+ 8388608 2^23 ---<-
+ 16777216 2^24 ---<-
+ 33554432 2^25 ---<-
+ 67108864 2^26 ---<--
+ 134217728 2^27 ---<--
+ 268435456 2^28 ---<--
+ 536870912 2^29 ---<--
+ 1073741824 2^30 ---<--
+ 2147483648 2^31 ---<--+
+ 4294967296 2^32 ---<--+
+ 8589934592 2^33 ---<--+
+ 17179869184 2^34 ---<--+
+ 34359738368 2^35 ---<--+-
+ 68719476736 2^36 ---<--+-
+ 137438953472 2^37 ---<--+-
+ 274877906944 2^38 ---<--+-
+ 549755813888 2^39 ---<--+-
+ 1099511627776 2^40 ---<--+--
+ 2199023255552 2^41 ---<--+--
+ 4398046511104 2^42 ---<--+--
+ 8796093022208 2^43 ---<--+--
+ 17592186044416 2^44 ---<--+--
+ 35184372088832 2^45 ---<--+-->
+ 70368744177664 2^46 ---<--+-->
+ 140737488355328 2^47 ---<--+-->
+ 281474976710656 2^48 ---<--+-->
+ 562949953421312 2^49 ---<--+-->-
+ 1125899906842624 2^50 ---<--+-->-
+ 2251799813685248 2^51 ---<--+-->-
+ 4503599627370496 2^52 ---<--+-->-
+ 9007199254740992 2^53 ---<--+-->-
+ 18014398509481984 2^54 ---<--+-->--
+ 36028797018963968 2^55 ---<--+-->--
+ 72057594037927936 2^56 ---<--+-->--
+ 144115188075855872 2^57 ---<--+-->--
+ 288230376151711744 2^58 ---<--+-->--
+ 576460752303423488 2^59 ---<--+-->--=
+ 1152921504606846976 2^60 ---<--+-->--=
+ 2305843009213693952 2^61 ---<--+-->--=
+ 4611686018427387904 2^62 ---<--+-->--=
+ 9223372036854775808 2^63 ---<--+-->--=-
+18446744073709551616 2^64 ---<--+-->--=-
+36893488147419103232 2^65 ---<--+-->--=-
barcat -f2 input/numcolumns.txt
1 2 3 4 ---
-10 20 30 40 -------<-+--=------>--------
+10 20 30 40 -------<-+->=---------------
3 16 9 123 -------<
4 5 12 7 -------<-+-
0:01:00
1:00:00 +
1:01:01 +
- 9:59:59 +-----=----->
-10:00:00 +-----=----->
-11:11:11 +-----=----->-
-24:00:00 +-----=----->------------------
+ 9:59:59 +-----=--->--
+10:00:00 +-----=--->--
+11:11:11 +-----=--->---
+24:00:00 +-----=--->--------------------
barcat -L9- input/intsine.txt
-7833 ------------------<---=--+-
-8415 ------------------<---=--+---
-8912 ------------------<---=--+---->
-9320 ------------------<---=--+---->--
-9636 ------------------<---=--+---->---
-9855 ------------------<---=--+---->----
-9975 ------------------<---=--+---->----
-9996 ------------------<---=--+---->----
-9917 ------------------<---=--+---->----
-9738 ------------------<---=--+---->---
-9463 ------------------<---=--+---->--
-9093 ------------------<---=--+---->-
-8632 ------------------<---=--+----
-8085 ------------------<---=--+--
-7457 ------------------<---=--+
-6755 ------------------<---=-
-5985 ------------------<--
-5155 ------------------
+7833 -----------------<----=--+-
+8415 -----------------<----=--+---
+8912 -----------------<----=--+---->
+9320 -----------------<----=--+---->--
+9636 -----------------<----=--+---->---
+9855 -----------------<----=--+---->----
+9975 -----------------<----=--+---->----
+9996 -----------------<----=--+---->----
+9917 -----------------<----=--+---->----
+9738 -----------------<----=--+---->---
+9463 -----------------<----=--+---->--
+9093 -----------------<----=--+---->-
+8632 -----------------<----=--+----
+8085 -----------------<----=--+--
+7457 -----------------<----=--+
+6755 -----------------<----=-
+5985 -----------------<---
+5155 -----------------<
4274 ---------------
3350 ------------
2392 --------
barcat -L14+3 input/intsine.txt
-9855 ------------------<---=--+---->----
-9975 ------------------<---=--+---->----
-9996 ------------------<---=--+---->----
+9855 -----------------<----=--+---->----
+9975 -----------------<----=--+---->----
+9996 -----------------<----=--+---->----
barcat -L-1 -s input/aligned.txt
-5.0less ---------<--+--=
+5.0less --------<---+--=
5 of 35 total in 7 values (1 min, 5.00 avg, 010 max)
barcat -L-2+1 -s input/aligned.txt
- 10. more --------<--+--=------->-------
+ 10. more --------<--+--=>--------------
10 of 35 total in 7 values (1 min, 5.00 avg, 010 max)
476 C --
619 Ĉ --
2094 D --<---+
-6552 E --<---+--=--->---------
+6552 E --<---+--=-->----------
1062 F --<-
766 G --<
738 Ĝ --<
371 H -
7 Ĥ
-5513 I --<---+--=--->------
+5513 I --<---+--=-->-------
1140 J --<-
38 Ĵ
2558 K --<---+--
-4253 L --<---+--=--->-
+4253 L --<---+--=-->--
2183 M --<---+-
-6321 N --<---+--=--->--------
-8110 O --<---+--=--->---------------
+6321 N --<---+--=-->---------
+8110 O --<---+--=-->----------------
2266 P --<---+-
-4387 R --<---+--=--->--
-5462 S --<---+--=--->-----
+4387 R --<---+--=-->---
+5462 S --<---+--=-->------
331 Ŝ -
-3534 T --<---+--=---
+3534 T --<---+--=-->
2579 U --<---+--
320 Ŭ -
1458 V --<--
383 Z -
# 23731 whitespace
-4217 … --<---+--=--->-
+4217 … --<---+--=-->--
\r0
68658 of 77982 total in 29 values over 31 lines (7 min, 2689.03 avg, 9324 max)
barcat --count input/duplicates.txt
- 3 thrice --+->=--
- 2 twice --+->
+ 3 thrice --+>-=--
+ 2 twice --+>-
1 once --+
-10 most --+->=-------------------
+10 most --+>-=-------------------
1 --+
1 indented --+
1 different --+
barcat -c -f0 input/duplicolumns.txt
-10 prefix 1 1 --+------=--->------------
+10 prefix 1 1 --+------=>---------------
1 random 2 2 --+
1 text 1 2 --+
barcat -c -f2 input/duplicolumns.txt
-4 prefix 1 1 ----<-----+--=----
-6 random 2 2 ----<-----+--=-------->----
+4 prefix 1 1 ----<-----+--=--->
+6 random 2 2 ----<-----+--=--->---------
1 prefix 3 0 ----<
1 prefix 2 ----<
barcat -c -f'prefix\ ' input/duplicolumns.txt
3 prefix 1 1 -------------------+
2 random 2 2 --------------
-4 prefix 3 1 -------------------+--->---
+4 prefix 3 1 -------------------+>------
3 prefix 2 1 -------------------+
barcat -c -f'(e.)' input/duplicates.txt
-17 thrice --+-------=--->------------
+17 thrice --+-------=>---------------
1 indented --
2 different --+
barcat -cf1 -l0 input/duplicates.txt
-18 -+-----------=----->-----------------
+18 -+-----------=>----------------------
1 -+
1 -+
barcat -cf+1 -l5 input/duplicolumns.txt
-4 pr… -----<-------+--=------
-6 ra… -----<-------+--=---------->------
+4 pr… -----<-------+--=----->
+6 ra… -----<-------+--=----->-----------
1 pr… -----<
1 pr… -----<
barcat -- input/seq3.txt
1 -------------
-2 ------------------------+
-3 ------------------------+------>------
+2 --------------------<---+
+3 --------------------<---+---->--------
barcat input/seq3.txt input/seq3.txt
1 -------------
-2 ------------------------+
-3 ------------------------+------>------
+2 -------------------<----+
+3 -------------------<----+----->-------
1 -------------
-2 ------------------------+
-3 ------------------------+------>------
+2 -------------------<----+
+3 -------------------<----+----->-------
cat input/seq3.txt | barcat
1 -------------
-2 ------------------------+
-3 ------------------------+------>------
+2 --------------------<---+
+3 --------------------<---+---->--------
barcat -- 1 4 8 2 6 3 9 5 2
1 ----
-4 ------------<---+
-8 ------------<---+-=--->-----------
+4 ----------<-----+
+8 ----------<-----+-=--->-----------
2 --------
-6 ------------<---+-=--->--
-3 ------------<
-9 ------------<---+-=--->---------------
-5 ------------<---+-=--
+6 ----------<-----+-=--->--
+3 ----------<--
+9 ----------<-----+-=--->---------------
+5 ----------<-----+-=--
2 --------
barcat -- -1 1
-1
- 1 ------------------|----------------->
+ 1 -----------<------|----->------------
barcat -M 1 -l 2 hi 3 --st 4 -- 5 -1 --version
1 -----|------
…
- 3 -----|------------<-=---+
- 4 -----|------------<-=---+----->
- 5 -----|------------<-=---+----->------
+ 3 -----|---------<----=---+
+ 4 -----|---------<----=---+--->--
+ 5 -----|---------<----=---+--->--------
-1
…
12 total in 5 values over 7 lines (-1 min, 2.40 avg, 5 max)
barcat -ct-7 input/duplicates.txt
-3 thrice ---------<-----+-=------->-----
-2 twice ---------<-----+-=---
+3 thrice ---------<-----+-=-->----------
+2 twice ---------<-----+-=-->
1 once ---------<
1 most ---------<
----- +++++++++++++++++
-6 most -----<-+----=>-------------------
+6 most -----<-+---->--------------------
1 -----<
-3 most ---+----=->--
+3 most ---+---->----
1 indented ---+
1 different ---+
1 different ---+
nan
▍ -1 negative -------
▏ -2 negativer
-▋ 0 zero ------------=|
-▋ .0 zeroer ------------=|
-▋-00 zeroest ------------=|
+▋ 0 zero ----------<-=|
+▋ .0 zeroer ----------<-=|
+▋-00 zeroest ----------<-=|
-█1.5 positive ------------=|-----------
+█1.5 positive ----------<-=|-----------
#nan
# -1 negative -------
# -2 negativer
-# 0 zero ------------=|
-# .0 zeroer ------------=|
-#-00 zeroest ------------=|
+# 0 zero ----------<-=|
+# .0 zeroer ----------<-=|
+#-00 zeroest ----------<-=|
#
-#1.5 positive ------------=|-----------
+#1.5 positive ----------<-=|-----------
barcat -aHl7 input/ascii.txt
-123u micro -------------<--=-+--------|
-100m long> -------------<--=-+--------|-
- -1 -------------<--=-+
+123u micro -----------<----=-+------>-|
+100m long> -----------<----=-+------>-|-
+ -1 -----------<----=-+
-2 ---------
-3
barcat --graph-format=* input/ascii.txt
-123e-6 micro **********<**=+******|
- .1 long line **********<**=+******|*
- -1 **********<**=+
+123e-6 micro ********<****=+****>*|
+ .1 long line ********<****=+****>*|*
+ -1 ********<****=+
-2 *******
-3
barcat --graph-format=─ input/ascii.txt
-123e-6 micro ──────────<──=+──────|
- .1 long line ──────────<──=+──────|─
- -1 ──────────<──=+
+123e-6 micro ────────<────=+────>─|
+ .1 long line ────────<────=+────>─|─
+ -1 ────────<────=+
-2 ───────
-3
barcat --graph-format=─ --markers='550v 11v 00v 999v 0100v' input/ascii.txt
-123e-6 micro 0──9──────────5───────
- .1 long line 0──9──────────5───────0
- -1 0──9──────────5
- -2 0──9───
+123e-6 micro 0─────────────5───────
+ .1 long line 0─────────────5───────0
+ -1 0─────────────5
+ -2 0──────
-3