Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ktorz/machination
Plot charts as unicode strings in the console.
https://github.com/ktorz/machination
console haskell histogram plot unicode
Last synced: 3 months ago
JSON representation
Plot charts as unicode strings in the console.
- Host: GitHub
- URL: https://github.com/ktorz/machination
- Owner: KtorZ
- License: mpl-2.0
- Created: 2020-05-16T16:03:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-16T16:27:43.000Z (over 4 years ago)
- Last Synced: 2024-09-26T07:08:39.850Z (4 months ago)
- Topics: console, haskell, histogram, plot, unicode
- Language: Haskell
- Size: 4.03 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
Machination> A Haskell library for text plotting in the terminal.
## Overview
### Histograms
Plot [histograms](https://en.wikipedia.org/wiki/Histogram) as unicode strings in the console. For example, one could plot answers and their frequencies to the question:
_"Who's your favorite metal band?"_
```hs
import Preludeimport Plot.Text.Histogram
( Histogram (..), plot )main :: IO ()
main = putStrLn $ do
plot $ Histogram
{ width = 80
, height = 24
, bins =
[ ( "Metallica", 78 )
, ( "Iron Maiden", 61 )
, ( "Slayer", 16 )
, ( "Dimmu Borgir", 3 )
, ( "Ghost", 48 )
]
}
```