y_lim adjusted

This commit is contained in:
pseusys
2023-02-26 18:48:37 +01:00
parent 6e502d247d
commit 812d0477c5

View File

@@ -9,7 +9,6 @@ from manager_download import DownloadManager as DM
MAX_LANGUAGES = 5 # Number of top languages to add to chart, for each year quarter MAX_LANGUAGES = 5 # Number of top languages to add to chart, for each year quarter
GRAPH_PATH = "assets/bar_graph.png" # Chart saving path. GRAPH_PATH = "assets/bar_graph.png" # Chart saving path.
GRAPH_Y_ZOOM = 1.3
async def create_loc_graph(yearly_data: Dict, save_path: str): async def create_loc_graph(yearly_data: Dict, save_path: str):
@@ -65,6 +64,6 @@ async def create_loc_graph(yearly_data: Dict, save_path: str):
ax.spines["top"].set_visible(False) ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False) ax.spines["right"].set_visible(False)
plt.ylim(top=GRAPH_Y_ZOOM * amax(cumulative[:, 0]), bottom=-GRAPH_Y_ZOOM * amax(cumulative[:, 1])) plt.ylim(top=1.1 * amax(cumulative[:, 0]), bottom=-1.5 * amax(cumulative[:, 1]))
plt.savefig(save_path, bbox_inches="tight") plt.savefig(save_path, bbox_inches="tight")
plt.close(fig) plt.close(fig)