Skip to content

Commit

Permalink
Merge pull request #1098 from bobbyxng/plot_summary_fix
Browse files Browse the repository at this point in the history
Bug-fix: plot_summary script generating empty pdfs.
  • Loading branch information
lisazeyen committed Jun 11, 2024
2 parents 8438153 + 1b0ef5e commit f2014c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if config["foresight"] == "perfect":

rule all:
input:
expand(RESULTS + "graphs/costs.pdf", run=config["run"]["name"]),
expand(RESULTS + "graphs/costs.svg", run=config["run"]["name"]),
default_target: True


Expand Down
6 changes: 3 additions & 3 deletions rules/postprocess.smk
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ rule plot_summary:
eurostat="data/eurostat/Balances-April2023",
co2="data/bundle/eea/UNFCCC_v23.csv",
output:
costs=RESULTS + "graphs/costs.pdf",
energy=RESULTS + "graphs/energy.pdf",
balances=RESULTS + "graphs/balances-energy.pdf",
costs=RESULTS + "graphs/costs.svg",
energy=RESULTS + "graphs/energy.svg",
balances=RESULTS + "graphs/balances-energy.svg",
threads: 2
resources:
mem_mb=10000,
Expand Down
4 changes: 2 additions & 2 deletions scripts/plot_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def plot_balances():
frameon=False,
)

fig.savefig(snakemake.output.balances[:-10] + k + ".pdf", bbox_inches="tight")
fig.savefig(snakemake.output.balances[:-10] + k + ".svg", bbox_inches="tight")


def historical_emissions(countries):
Expand Down Expand Up @@ -563,7 +563,7 @@ def plot_carbon_budget_distribution(input_eurostat, options):
)

plt.grid(axis="y")
path = snakemake.output.balances.split("balances")[0] + "carbon_budget.pdf"
path = snakemake.output.balances.split("balances")[0] + "carbon_budget.svg"
plt.savefig(path, bbox_inches="tight")


Expand Down

0 comments on commit f2014c2

Please sign in to comment.