Skip to content

Commit

Permalink
Improve plots (#51)
Browse files Browse the repository at this point in the history
* make plots longer to fit legend

* set plots to 600 dpi

* fix typo
  • Loading branch information
yerbol-akhmetov authored Jun 20, 2024
1 parent baf8709 commit 5ce9458
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plots/plot_electricity_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,5 @@ def plot_pies(ax, elec_mix_array):
# move to base directory
change_path_to_base()

plt.savefig(snakemake.output.figure, dpi=300, bbox_inches="tight")
plt.savefig(snakemake.output.figure, dpi=600, bbox_inches="tight")

6 changes: 3 additions & 3 deletions plots/plot_historic_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def plot_pies(ax, elec_mix_array):
)

# Calculate total generated electricity
total_electricity = np.sum(vals)
total_electricity = total_elec
# Add total generated electricity to the center of the pie chart
ax.text(0, 0, f"{total_electricity/1e6:.2f}"+"\nTWh", ha='center', va='center', fontsize=4)
ax.text(0, 0, f"{total_electricity:.2f}"+"\nTWh", ha='center', va='center', fontsize=4)
ax.set(aspect="equal")


Expand Down Expand Up @@ -123,5 +123,5 @@ def plot_pies(ax, elec_mix_array):
loc="lower center", ncol=5, fontsize=4, bbox_to_anchor=(0.5, -0.15)
)

plt.savefig(PATH_PLOTS+"plot_historic_generation.png", dpi=300, bbox_inches="tight")
plt.savefig(PATH_PLOTS+"plot_historic_generation.png", dpi=600, bbox_inches="tight")
logger.info("Saved plot of historic electricity generation mix for 2022!")
2 changes: 1 addition & 1 deletion plots/plot_total_costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def plot_costs(cost_df, clusters, planning_horizon, plot_width=7):
new_columns = df.sum().sort_values().index


fig, ax = plt.subplots(figsize=(plot_width, 8))
fig, ax = plt.subplots(figsize=(plot_width, 9))

df.loc[new_index].T.plot(
kind="bar",
Expand Down
2 changes: 1 addition & 1 deletion scripts/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def run_workflow(scenario, horizon, improved_cop=False):
# read sink_T from flexible scenario for improved COP runs
sink_T = read_sink_T("flexible", horizon)
update_sink_T(scenario, horizon, sink_T)
jjhhjsd

# run full network preparation and solving workflow
run_status = run_workflow(scenario, horizon)

Expand Down

0 comments on commit 5ce9458

Please sign in to comment.