-- Take time series with time resolutions and creates chart with original and modified series
drawResampled :: TS.Series Double -> TS.TimeResolution -> IO ()
drawResampled ts dt = do
    args <- getArgs
    let fn = head args
    let startTime = UTCTime (fromGregorian 1965 1 1) 0
    let xs = TS.resample startTime dt ts
    toFile def "dist/resample.svg" $ do
        layout_title .= fn
        setColors [opaque blue, opaque red]
        plot (line "Original series" [signal ts])
        plot (line "Resampled series" [signal xs])
    putStrLn "Plot saved to: dist/resample.svg"
    _ <- createProcess (shell "firefox dist/resample.svg")
    return ()
drawResampled :: TS.Series Double -> TS.TimeResolution -> IO ()
drawResampled ts dt = do
    args <- getArgs
    let fn = head args
    let startTime = UTCTime (fromGregorian 1965 1 1) 0
    let xs = TS.resample startTime dt ts
    toFile def "dist/resample.svg" $ do
        layout_title .= fn
        setColors [opaque blue, opaque red]
        plot (line "Original series" [signal ts])
        plot (line "Resampled series" [signal xs])
    putStrLn "Plot saved to: dist/resample.svg"
    _ <- createProcess (shell "firefox dist/resample.svg")
    return ()
drawResampled ts dt = do
    args <- getArgs
    let fn = head args
    let startTime = UTCTime (fromGregorian 1965 1 1) 0
    let xs = TS.resample startTime dt ts
    toFile def "dist/resample.svg" $ do
        layout_title .= fn
        setColors [opaque blue, opaque red]
        plot (line "Original series" [signal ts])
        plot (line "Resampled series" [signal xs])
    putStrLn "Plot saved to: dist/resample.svg"
    _ <- createProcess (shell "firefox dist/resample.svg")
    return ()