LinuxAnswers - the LQ Linux tutorial section.
Go Back > Blogs > Bits and Pixels
User Name


Concerning free software, programming, and whatever else I find interesting. Also the blog for my Web site,
Rate this Entry

More fun with Haskell plotting: Functions of functions

Posted 04-08-2013 at 12:56 AM by hydraMax

import Graphics.Gnuplot.Simple
f x a = (x + a) * (x - a) * (x + 2*a)
fs f l = map f [1..l]
main = plotFuncs
         [Key Nothing, Title "(x + a)(x - a)(x + 2a) for a over 1..10"]
         (linearScale 1000 (-10,10))
         (fs f (10 :: Double))
See attached graph.
Attached Images
File Type: png (x+a)(x-a)(x+2a).png (83.9 KB, 4 views)
Posted in Uncategorized
Views 328 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 03:40 AM.

Main Menu

Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration