programlibs/Plot/demos/weather.xtl

A year of weather in text charts: rainfall by month as bars, temperatures as a sparkline, a scatter of temperature against rain, and the temperatures as a line chart picture. Run with "just demo Plot weather".

source · imports p: libs/Plot/src/Plot.xtl

months : Box Char

value · line 8
months ← "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"

rain : Int

value · line 9
rain ← 102 86 79 52 41 18 5 9 22 61 95 118           ⍝ mm

temp : Int

value · line 10
temp ← 8 9 12 15 19 23 27 27 23 17 11 8              ⍝ degrees C

picture : Char

value · line 18
picture ← ᵖl̲ine! temp                                 ⍝ shown as a picture

both : Char

value · line 22
both ← ("A year of weather" "month" "mm, degrees C" "rain" "temperature") ᵖc̲hart! (e̲nclose rain) c̲at e̲nclose temp