LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Blogs > Bits and Pixels
User Name
Password

Notices

Concerning free software, programming, and whatever else I find interesting. Also the blog for my Web site, frigidcode.com.
Old

More fun with Haskell plotting: Functions of functions

Posted 04-08-2013 at 12:56 AM by hydraMax (Bits and Pixels)

Code:
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)
Member
Posted in Uncategorized
Views 333 Comments 0 hydraMax is offline

  



All times are GMT -5. The time now is 08:11 PM.

Main Menu
Advertisement

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