Kaynağa Gözat

Fix title cutoff for comm interval plots

dustin.born 6 yıl önce
ebeveyn
işleme
9729289005
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 5 0
      code/ID2TLib/Statistics.py

+ 5 - 0
code/ID2TLib/Statistics.py

@@ -1211,6 +1211,11 @@ class Statistics:
 
             title_distance = 1 + 0.012*52.8/plt_height  # orginally, a good title distance turned out to be 1.012 with a plot height of 52.8
 
+            # if title would be cut off, set minimum width
+            min_width = len(title) * 0.15
+            if plt_width < min_width:
+                plt_width = min_width
+
             plt.gcf().set_size_inches(plt_width, plt_height)  # set plot size
 
             # set additional plot parameters