Skip to content

Instantly share code, notes, and snippets.

@matthewpalmer
Created January 18, 2015 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewpalmer/021ce6a0e715474bff70 to your computer and use it in GitHub Desktop.
Save matthewpalmer/021ce6a0e715474bff70 to your computer and use it in GitHub Desktop.
module Plot (Plot.plot)
where
import Graphics.Rendering.Chart.Easy
import Graphics.Rendering.Chart.Backend.Cairo
import Data.Complex
import Spectrum
-- An artificial max to make sure all graphs are the same height
maxHeight = 25000
dummyList :: [(Double, Double)]
dummyList = [(0, maxHeight)]
plot :: [(Double, Double)] -> String -> FilePath -> IO()
plot input title filePath = do
toFile def filePath $ do
layout_title .= title
Graphics.Rendering.Chart.Easy.plot (line "magnitude" [input])
--Graphics.Rendering.Chart.Easy.plot (points "points" input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment