Skip to content

Commit

Permalink
Fixed bug which generated empty pdfs when calling plot_summary from C…
Browse files Browse the repository at this point in the history
…I or snakemake. Using .svg exports instead.
  • Loading branch information
bobbyxng committed Jun 11, 2024
1 parent 8438153 commit 0db78a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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 0db78a9

Please sign in to comment.