plot-gtk-ui: A quick way to use Mathematica like Manipulation abilities

[ gpl, library, math ] [ Propose Tags ]
This version is deprecated.

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]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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.7 && <4.8), cairo (>=0.13 && <0.14), colour (>=2.3 && <2.4), fixed-vector (>=0.7.0.0), gtk (>=0.13 && <0.14), hmatrix (>=0.16 && <0.17), plot (>=0.2 && <0.3), text (>=1.2 && <1.3), vector (>=0.10.12.2 && <0.10.13.0) [details]
License GPL-2.0-only
Author Sumit Sahrawat
Maintainer sumit.sahrawat.apm13@iitbhu.ac.in
Category Math
Home page https://github.com/sumitsahrawat/plot-gtk-ui
Source repo head: git clone https://github.com/sumitsahrawat/plot-gtk-ui.git
Uploaded by sumitsahrawat at 2015-03-15T01:15:17Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 4190 total (23 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-03-15 [all 1 reports]

Readme for plot-gtk-ui-0.0.3.0

[back to package description]

plot-gtk-ui

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

Installation

Linux

The installation for gtk requires that gtk2hs-buildtools be installed, and the binary be in your $PATH. The below commands take care of that, without permanently changing the $PATH.

$ cabal update
$ cabal install gtk2hs-buildtools
$ env PATH="~/.cabal/bin:$PATH" cabal install plot-gtk-ui

Windows

  • Install gtk2hs with instructions from here.

  • Then use cabal to install plot-gtk-ui.

cmd> cabal install plot-gtk-ui

Usage

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.