Fixed bug which generated empty pdfs when calling plot_summary from CI or snakemake. Using .svg exports instead.

This commit is contained in:
Bobby Xiong 2024-06-11 15:10:12 +02:00
parent 8438153638
commit 0db78a93e6
2 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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):
@ -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")