plot-gtk-0.2: GTK plots and interaction with GHCi

Portabilityportable
Stabilityprovisional
Maintainerhaskell.vivian.mcphail <at> gmail <dot> com
Safe HaskellNone

Graphics.Rendering.Plot.HMatrix

Contents

Description

Compatability module to replace Graphics.Plot of the hmatrix module

Provides all functions from hmatrix's Graphics.Plot as well as those functions appended with H which return a PlotHandle for interactive update.

Synopsis

Plotting functions

mplot :: [Vector Double] -> IO ()Source

plot several vectors against the first

mplotH :: [Vector Double] -> IO PlotHandleSource

plot several vectors against the first

plot :: [Vector Double -> Vector Double] -> (Double, Double) -> Int -> IO ()Source

Draws a list of functions over a desired range and with a desired number of points

 > plot [sin, cos, sin.(3*)] (0,2*pi) 1000

plotH :: [Vector Double -> Vector Double] -> (Double, Double) -> Int -> IO PlotHandleSource

Draws a list of functions over a desired range and with a desired number of points

 > plot [sin, cos, sin.(3*)] (0,2*pi) 1000

parametricPlot :: (Vector Double -> (Vector Double, Vector Double)) -> (Double, Double) -> Int -> IO ()Source

Draws a parametric curve. For instance, to draw a spiral we can do something like:

 > parametricPlot (\t->(t * sin t, t * cos t)) (0,10*pi) 1000

parametricPlotH :: (Vector Double -> (Vector Double, Vector Double)) -> (Double, Double) -> Int -> IO PlotHandleSource

Draws a parametric curve. For instance, to draw a spiral we can do something like:

 > parametricPlot (\t->(t * sin t, t * cos t)) (0,10*pi) 1000

imshow :: Matrix Double -> IO ()Source

imshow shows a representation of a matrix as a gray level image.

greyscaleH :: Matrix Double -> IO PlotHandleSource

greyscaleH shows a representation of a matrix as a gray level image.

meshdom :: Vector Double -> Vector Double -> (Matrix Double, Matrix Double)Source

From vectors x and y, it generates a pair of matrices to be used as x and y arguments for matrix functions.

Compatability

matrixToPGM :: Matrix Double -> StringSource

writes a matrix to pgm image file

Gnuplot functions

splot :: (Matrix Double -> Matrix Double -> Matrix Double) -> (Double, Double) -> (Double, Double) -> Int -> IO ()Source

Draws the surface represented by the function f in the desired ranges and number of points, internally using mesh.

 > let f x y = cos (x + y) 
 > splot f (0,pi) (0,2*pi) 50    

mesh :: Matrix Double -> IO ()Source

Draws a 3D surface representation of a real matrix.

 > mesh (hilb 20)

In certain versions you can interactively rotate the graphic using the mouse.