From 7b2abd715336f324e05f6c90e567192b608bc0e4 Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Wed, 3 Dec 2008 21:52:52 +0100 Subject: [PATCH] added a good-looking legend to the due cards graph. i feel dirty now. --- anki/graphs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/anki/graphs.py b/anki/graphs.py index 817229f14..0fc5f28e5 100644 --- a/anki/graphs.py +++ b/anki/graphs.py @@ -101,6 +101,13 @@ from cards where reps > 0 and priority != 0 and type = 1 and interval > 21""") self.filledGraph(graph, days, ["#7777ff", "#77ffff", "#ff7777"], *argl) + cheat = fig.add_subplot(111) + cheat.bar(0, 0, color = "#ff7777", label = _("New cards")) + cheat.bar(1, 0, color = "#77ffff", label = _("Young cards")) + cheat.bar(2, 0, color = "#7777ff", label = _("Mature cards")) + + cheat.legend(loc = 'upper right') + graph.set_ylabel(_("Cards")) graph.set_xlabel(_("Days")) graph.set_xlim(xmin=self.stats['lowestInDay'], xmax=days)