Skip to content

Commit

Permalink
Refine mark03 plots (#187)
Browse files Browse the repository at this point in the history
Fixed legend and axes label sizes, left figure at default size.
  • Loading branch information
gordonkoehn authored Oct 16, 2023
1 parent 377a87a commit c7a4c85
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions workflows/mark03.smk
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def legend_without_duplicate_labels(figure):
"""Add a legend to a figure without duplicate labels."""
handles, labels = plt.gca().get_legend_handles_labels()
by_label = dict(zip(labels, handles))
figure.legend(by_label.values(), by_label.keys(), loc='upper right')
figure.legend(by_label.values(), by_label.keys(), loc='upper right', fontsize=13)


def plot_iteration_metric(all_chain_metrics : list[str], metric : str, output_path : str, initial_tree_type : list) :
Expand Down Expand Up @@ -371,7 +371,7 @@ def plot_iteration_metric(all_chain_metrics : list[str], metric : str, output_pa
distances_chains.append(distances)

# Create a figure and axis
fig, ax = plt.subplots(figsize=(4,3))
fig, ax = plt.subplots()

# Define the list of colors to repeat
colors = {"h": "red", "s": "green", "d": "blue", "r": "orange", "m": "purple"}
Expand Down Expand Up @@ -427,8 +427,11 @@ def plot_iteration_metric(all_chain_metrics : list[str], metric : str, output_pa
)

# Set labels and title
ax.set_ylabel(f"Similarity: {metric}")
ax.set_xlabel("Iteration")
ax.set_ylabel(f"Similarity: {metric}", fontsize=13)
ax.set_xlabel("Iteration", fontsize=13)

#increade axes label size
ax.tick_params(labelsize=13)

# add gridlines
ax.grid(True)
Expand Down Expand Up @@ -471,7 +474,7 @@ def plot_iteration_log_prob(all_chain_logProb : list[str], output_path : str, in
logP_chains.append(logP)

# Create a figure and axis
fig, ax = plt.subplots(figsize=(4,3))
fig, ax = plt.subplots()

# Define the list of colors to repeat
colors = {
Expand Down Expand Up @@ -531,8 +534,11 @@ def plot_iteration_log_prob(all_chain_logProb : list[str], output_path : str, in
)

# Set labels and title
ax.set_ylabel(f"Log-Likelihood " + r"$\log(P(D|T,\theta))$")
ax.set_xlabel("Iteration")
ax.set_ylabel(f"Log-Posterior " + r"$\log(P(D|T,\theta))$", fontsize=13)
ax.set_xlabel("Iteration", fontsize=13)

# increade axes label size
ax.tick_params(labelsize=13)

# add gridlines
ax.grid(True)
Expand Down

0 comments on commit c7a4c85

Please sign in to comment.