Browse Source

adjust pic display

master
杨浩然 4 years ago
parent
commit
3f30319d80
2 changed files with 6 additions and 10 deletions
  1. BIN
      COVID-19/Project/.vs/Project/v16/.suo
  2. +6
    -10
      COVID-19/Project/Project/Project.py

BIN
COVID-19/Project/.vs/Project/v16/.suo View File


+ 6
- 10
COVID-19/Project/Project/Project.py View File

@ -46,16 +46,12 @@ recovered = [dfChinaJan['Recovered'].sum(),dfChinaFeb['Recovered'].sum(),dfChina
recoverPoss = []
for i in range(len(confirmed)):
recoverPoss.append(recovered[i] / confirmed[i])
date = pd.date_range(start='2020-01', periods=12, freq="m").strftime('%Y-%m')
data_1={
'confirmed':confirmed,
'recovered':recovered,
'recoverPoss':recoverPoss
}
data_1_df = pd.DataFrame(data_1, index=date)
ax = data_1_df.plot(secondary_y=['recovery possibility'], x_compat=True, grid=True)
ax.set_ylabel('confirmed/recovered')
ax.grid(linestyle="--", alpha=0.3)
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.plot(date,confirmed,recovered)
ax2 = ax1.twinx()
ax2.plot(date,recoverPoss)
plt.show()

Loading…
Cancel
Save