LinuxQuestions.org
Visit Jeremy's Blog.
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

Quick and dirty plotting with Haskell: Supplement

Posted 01-15-2013 at 12:54 AM by hydraMax (Bits and Pixels)

I just wanted to add a brief note to my previous post: It is also quite simple to do a plot with multiple functions. The following code gives the graph seen in the attached PNG:

Code:
h> import Graphics.Gnuplot.Simple
h> let f x = 3 - 2*x + 4*x**2
h> let g x = 8*x - 2
h> let h a x = g a * (x - a) + f a
h> plotFuncs [] (linearScale 1000 (-10,10)) [f, g, h (-5)]
f(x) is a function, g(x) is the derivative of f(x), and...
Attached Images
File Type: png plotFuncs.png (49.5 KB, 4 views)
Member
Posted in Uncategorized
Views 521 Comments 0 hydraMax is offline

  



All times are GMT -5. The time now is 09:47 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration