Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mstksg/interactive-plot
Quick interactive time series terminal plots usable in ghci
https://github.com/mstksg/interactive-plot
Last synced: 3 months ago
JSON representation
Quick interactive time series terminal plots usable in ghci
- Host: GitHub
- URL: https://github.com/mstksg/interactive-plot
- Owner: mstksg
- License: bsd-3-clause
- Created: 2018-07-17T22:00:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-10T23:09:31.000Z (over 5 years ago)
- Last Synced: 2024-05-02T00:12:36.386Z (9 months ago)
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/interactive-plot
- Size: 1.2 MB
- Stars: 15
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[interactive-plot][]
====================[interactive-plot]: https://hackage.haskell.org/package/interactive-plot
Quick time series terminal plotting for data exploration/in ghci.
Most commonly used imports should be available in *Interactive.Plot*.
Construct a `Series` from scratch using the raw data type, or use one of the
handy helpers:1. `listSeries`: Create a series from a list or any foldable.
2. `tupleSeries`: Create a series from a list of ordered-pair tuples providing
x and y locations.
3. `funcSeries`: Create a series from a function `Double -> Double`, given a
range of `x`s to produce the `y`s.Then simply "run" a list of series (or "automatic-styled series") using
`runPlotAuto` or `runPlot`:```haskell
runPlotAuto
:: PlotOpts -- ^ options (can be 'defaultPlotOpts')
-> Maybe String -- ^ optional title
-> [AutoSeries] -- ^ uninitialized data of serieses
-> IO ()
```![Static Plots](https://i.imgur.com/SkH1C1j.gif)
These plots can be zoomed, stretched, scaled, panned interactively after
launch. If you quit, things resume back to the ghci session (or whatever point
in the program you launch from).There are also options for rudimentary animations:
```haskell
animatePlot
:: PlotOpts
-> Double -- ^ update rate (frames per second)
-> Maybe String -- ^ title
-> [[Series]] -- ^ list of series data (potentially infinite)
-> IO ()animatePlotFunc
:: PlotOpts
-> Maybe String -- ^ title
-> (Double -> Maybe [Series]) -- ^ function from time to plot. will quit
-- as soon as 'Nothing' is returned.
-> IO ()
```![Animated Plots](https://i.imgur.com/37Cq8ET.gif)
Todo
----* Consider being able to use functions directly as a series, instead of
converting them into ordered pairs based on a known x series.
* 2D density plots?
* I'm sure usability could always be improved :)