Преглед на файлове

Add the title to saved images

Vadim Markovtsev преди 7 години
родител
ревизия
11871f6ff6
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4 3
      labours.py

+ 4 - 3
labours.py

@@ -254,12 +254,13 @@ def plot_project(args, name, matrix, date_range_sampling, labels, granularity,
         labels[endindex].set_text = lambda _: None
         labels[endindex].set_rotation(30)
         labels[endindex].set_ha("right")
+    title = "%s %d x %d (granularity %d, sampling %d)" % \
+        ((name,) + matrix.shape + (granularity, sampling))
     if not args.output:
-        pyplot.gcf().canvas.set_window_title(
-            "%s %d x %d (granularity %d, sampling %d)" %
-            ((name,) + matrix.shape + (granularity, sampling)))
+        pyplot.gcf().canvas.set_window_title(title)
         pyplot.show()
     else:
+        pyplot.title(title)
         pyplot.tight_layout()
         if args.mode == "project":
             output = args.output