sort plot labels by score

This commit is contained in:
xenia 2020-12-04 20:45:47 -05:00
parent 304a16b98b
commit 5365272e27
1 changed files with 8 additions and 3 deletions

View File

@ -97,9 +97,14 @@
(set-pts! mid now pts)) (set-pts! mid now pts))
(plot-x-ticks (date-ticks)) (plot-x-ticks (date-ticks))
(plot (for/list ([(mid data) (in-hash point-tls)]) (define ordered-mids
(lines data (sort (hash-keys point-tls)
#:label (hash-ref member-names mid) (lambda (a b)
(>= (get-last-pts (hash-ref point-tls a)) (get-last-pts (hash-ref point-tls b))))))
(plot (for/list ([mid (in-list ordered-mids)])
(lines (hash-ref point-tls mid)
#:label (format "~a (~a pts)" (hash-ref member-names mid)
(get-last-pts (hash-ref point-tls mid)))
#:color mid #:color mid
#:style mid #:style mid
#:width 2)) #:width 2))