From 8038361c7664ccf50141d0417e7d4f114d9b889f Mon Sep 17 00:00:00 2001 From: K4RP4T Date: Sun, 26 May 2024 12:52:54 +0200 Subject: [PATCH] added custom Y axis range --- app/Main.hs | 2 ++ app/Plot.hs | 1 + plot/weather.svg | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Main.hs b/app/Main.hs index e8181a7..52ec34b 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -14,6 +14,8 @@ main :: IO () main = do apiKey <- getWeatherKey + generatePlot 20 35 25 --example + putStrLn "Enter a city name: " city <- getLine diff --git a/app/Plot.hs b/app/Plot.hs index f3304a8..c6f291b 100644 --- a/app/Plot.hs +++ b/app/Plot.hs @@ -11,5 +11,6 @@ generatePlot :: Double -> Double -> Double -> IO () generatePlot yday tday tmrw = toFile def "plot/weather.svg" $ do layout_title .= "Yesterday, Today, and Tomorrow's Temperatures" layout_margin .= 30 + layout_y_axis . laxis_generate .= scaledAxis def (-10, 40) layout_x_axis . laxis_generate .= autoIndexAxis ["Yesterday", "Today", "Tomorrow"] plot $ line "Degrees Celsius" [formatData yday tday tmrw] \ No newline at end of file diff --git a/plot/weather.svg b/plot/weather.svg index 30d444f..d308773 100644 --- a/plot/weather.svg +++ b/plot/weather.svg @@ -1,3 +1,3 @@ \ No newline at end of file + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> \ No newline at end of file