add axis labels
This commit is contained in:
@@ -28,6 +28,7 @@ def plot(data, countries):
|
||||
|
||||
for ax, fig, name in [(tc, tcp, "total_cases"), (td, tdp, "total_deaths"), (nc, ncp, "new_cases"), (nd, ndp, "new_deaths")]:
|
||||
ax.set_yscale("log")
|
||||
ax.set_ylabel(name)
|
||||
for tick in ax.get_xticklabels():
|
||||
tick.set_rotation(45)
|
||||
ax.legend(frameon=False)
|
||||
|
||||
@@ -17,6 +17,7 @@ def plot(data, countries):
|
||||
pp.plot(time, np.array(total_deaths)/np.array(total_cases), label=f"{loc}", marker=".")
|
||||
|
||||
pp.yscale("log")
|
||||
pp.ylabel("relative deaths")
|
||||
pp.xticks(rotation=45)
|
||||
pp.legend(frameon=False)
|
||||
pp.tight_layout()
|
||||
|
||||
@@ -18,6 +18,8 @@ def plot(data, countries):
|
||||
pp.plot(new_time_axis, np.array(total_cases), label=f"{loc}", marker=".")
|
||||
|
||||
pp.yscale("log")
|
||||
pp.ylabel("total cases")
|
||||
pp.xlabel("day since first reported death")
|
||||
pp.xticks(rotation=45)
|
||||
pp.legend(frameon=False)
|
||||
pp.tight_layout()
|
||||
|
||||
@@ -19,6 +19,8 @@ def plot(data, countries):
|
||||
|
||||
pp.yscale("log")
|
||||
pp.xticks(rotation=45)
|
||||
pp.ylabel("total cases")
|
||||
pp.xlabel("days since 100 reported cases")
|
||||
pp.legend(frameon=False)
|
||||
axis = pp.axis()
|
||||
pp.axis([-2, axis[1], 80, axis[3]])
|
||||
|
||||
Reference in New Issue
Block a user