plot_utils: move common plotting functions out of thermal into a file of their own
diff --git a/cr2/thermal.py b/cr2/thermal.py
index 17614fc..1b3fc14 100644
--- a/cr2/thermal.py
+++ b/cr2/thermal.py
@@ -8,45 +8,7 @@
import pandas as pd
from matplotlib import pyplot as plt
-GOLDEN_RATIO = 1.618034
-
-def set_plot_size(width, height):
- """Set the plot size.
-
- This has to be called before calls to .plot()
- """
- if height is None:
- if width is None:
- height = 6
- width = 10
- else:
- height = width / GOLDEN_RATIO
- else:
- if width is None:
- width = height * GOLDEN_RATIO
-
- plt.figure(figsize=(width, height))
-
-def normalize_title(title, opt_title):
- """
- Return a string with that contains the title and opt_title if it's not the empty string
-
- See test_normalize_title() for usage
- """
- if opt_title is not "":
- title = opt_title + " - " + title
-
- return title
-
-def default_plot_settings(title=""):
- """Set xlabel and title of the plot
-
- This has to be called after calls to .plot()
- """
-
- plt.xlabel("Time")
- if title:
- plt.title(title)
+from plot_utils import set_plot_size, normalize_title, default_plot_settings
class BaseThermal(object):
"""Base class to parse trace.dat dumps.