Skip to content

Commit 7e55467

Browse files
committed
Set figure sizes and fonts
1 parent 94b66b6 commit 7e55467

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/conformist/performance_report.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66

77
class PerformanceReport(OutputDir):
8+
FIGURE_FONTSIZE = 12
9+
FIGURE_WIDTH = 12
10+
FIGURE_HEIGHT = 8
11+
plt.rcParams.update({'font.size': FIGURE_FONTSIZE})
12+
813
def __init__(self, base_output_dir):
914
self.create_output_dir(base_output_dir)
1015

@@ -45,7 +50,8 @@ def _class_report(self,
4550
ylabel,
4651
color):
4752
# Reset plt
48-
plt.figure()
53+
plt.figure(figsize=(self.FIGURE_WIDTH,
54+
self.FIGURE_HEIGHT))
4955

5056
# Sort the dictionary by its values
5157
mean_sizes = dict(sorted(items_by_class.items(),

src/conformist/validation_trial.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99

1010
class ValidationTrial(OutputDir):
11+
FIGURE_FONTSIZE = 12
12+
FIGURE_WIDTH = 12
13+
FIGURE_HEIGHT = 8
14+
plt.rcParams.update({'font.size': FIGURE_FONTSIZE})
15+
1116
def __init__(self, runs, class_names=[]):
1217
self.runs = runs
1318
self.class_names = class_names
@@ -117,7 +122,8 @@ def run_reports(self, base_output_dir):
117122
print(f'Reports saved to {self.output_dir}')
118123

119124
def visualize_empirical_fnr(self):
120-
plt.figure()
125+
plt.figure(figsize=(self.FIGURE_WIDTH,
126+
self.FIGURE_HEIGHT))
121127

122128
# Generate a pastel palette
123129
color_palette = sns.color_palette("deep")

0 commit comments

Comments
 (0)