added custom Y axis range

This commit is contained in:
K4RP4T 2024-05-26 12:52:54 +02:00
parent 6c2b12c89b
commit 8038361c76
3 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,8 @@ main :: IO ()
main = do
apiKey <- getWeatherKey
generatePlot 20 35 25 --example
putStrLn "Enter a city name: "
city <- getLine

View File

@ -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]

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 99 KiB