The plot-gtk-ui package

[ Tags: gpl, library, math ] [ Propose Tags ]

A pre-built ui for plotting based on plot. Quicker to use than plot-gtk, but less configurable, and less versatile.

Only provides ability to plot mathematical functions. But, also allows dynamic plotting functionality similar to Mathematica.


[Skip to Readme]

Properties

Versions 0.0.1.0, 0.0.2.0, 0.0.3.0, 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.3.0.1, 0.3.0.2 (info)
Dependencies base (>=4.6 && <5.0), cairo, colour, fixed-vector, gtk, hmatrix, plot, text, vector [details]
License GPL-2
Author Sumit Sahrawat
Maintainer sumit.sahrawat.apm13@iitbhu.ac.in
Category Math
Home page https://github.com/sumitsahrawat/plot-gtk-ui
Source repository head: git clone https://github.com/sumitsahrawat/plot-gtk-ui.git
Uploaded Mon Oct 10 17:02:43 UTC 2016 by sumitsahrawat
Distributions LTSHaskell:0.3.0.2, NixOS:0.3.0.2, Tumbleweed:0.3.0.2
Downloads 802 total (12 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-10-10 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for plot-gtk-ui-0.3.0.2

[back to package description]

plot-gtk-ui

Build Status

An ambitious attempt to provide mathematica like dynamic plotting for free.

Installation

stack install plot-gtk-ui

Usage

The best way to try this is to use the calculator package.

Import Graphics.Rendering.Plot.Gtk.UI and follow the examples below.

import Graphics.UI.Gtk
import Graphics.Rendering.Plot.Gtk.UI

main = do
  initGUI
  plotStatic sin (-pi, pi)
  -- Plot sin(x) from -pi to pi
  mainGUI

sinx

Another simple example.

import Graphics.UI.Gtk
import Graphics.Rendering.Plot.Gtk.UI

main = do
  initGUI
  plotDynamic (\(x, a) -> sin(a * x)) ((-pi, pi), (0, 1))
  -- Plot sin(a * x), where 'x' ranges from -pi to
  -- pi and 'a' ranges between 0 to 1
  mainGUI

sinax

Errors

The error messages might not be completely correct, as there is not a good way to diagnose what caused the error.

Issues that cause errors:

  • Invalid ranges, e.g. X-Range = (1, -1)
  • Automatic-determination of ranges resulting in unplottable ranges, e.g. (0, 0)

If you land on the "Gray screen of no plots" or any other incorrect error message, please raise an issue here.

Implementation

The plotStatic and plotDynamic functions are implemented in a type-safe manner using fixed-vector.

It also allows one to write functions using appropriate tuples as in the above examples.

Plotting is done using the excellent plot package.