Skip to content

Commit

Permalink
Set figure sizes and fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
mariya committed Nov 23, 2024
1 parent 94b66b6 commit 7e55467
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/conformist/performance_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@


class PerformanceReport(OutputDir):
FIGURE_FONTSIZE = 12
FIGURE_WIDTH = 12
FIGURE_HEIGHT = 8
plt.rcParams.update({'font.size': FIGURE_FONTSIZE})

def __init__(self, base_output_dir):
self.create_output_dir(base_output_dir)

Expand Down Expand Up @@ -45,7 +50,8 @@ def _class_report(self,
ylabel,
color):
# Reset plt
plt.figure()
plt.figure(figsize=(self.FIGURE_WIDTH,
self.FIGURE_HEIGHT))

# Sort the dictionary by its values
mean_sizes = dict(sorted(items_by_class.items(),
Expand Down
8 changes: 7 additions & 1 deletion src/conformist/validation_trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@


class ValidationTrial(OutputDir):
FIGURE_FONTSIZE = 12
FIGURE_WIDTH = 12
FIGURE_HEIGHT = 8
plt.rcParams.update({'font.size': FIGURE_FONTSIZE})

def __init__(self, runs, class_names=[]):
self.runs = runs
self.class_names = class_names
Expand Down Expand Up @@ -117,7 +122,8 @@ def run_reports(self, base_output_dir):
print(f'Reports saved to {self.output_dir}')

def visualize_empirical_fnr(self):
plt.figure()
plt.figure(figsize=(self.FIGURE_WIDTH,
self.FIGURE_HEIGHT))

# Generate a pastel palette
color_palette = sns.color_palette("deep")
Expand Down

0 comments on commit 7e55467

Please sign in to comment.