LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 676 Comments 0 hydraMax is offline

  



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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration