Skip to content

Commit

Permalink
presentazione
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardperreca committed Dec 12, 2022
1 parent 36e0aaa commit 7c77255
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
Binary file added Visualizzazione Scientifica/ELEZIONI ITALIANE.pdf
Binary file not shown.
Binary file not shown.
80 changes: 40 additions & 40 deletions Visualizzazione Scientifica/scripts/plotMerging.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,43 +58,43 @@
for i, row in df.iterrows():
dictCheck[row["year"]][row["check"]] += row["PERCENTUALE"]

# for key, value in dictCheck.items():
# print(key, value)

# dictCheck = dict(sorted(dictCheck.items()))

# y = np.array([dictCheck[i]["centroDestra"] for i in dictCheck.keys()])
# x = np.array([i for i in dictCheck.keys()])
# cubic_interpolation_model = interp1d(x, y, kind="cubic")
# x_ = np.linspace(x.min(), x.max(), 200)
# y_ = cubic_interpolation_model(x_)
# plt.plot(x_, y_, color="b")

# # y2 = np.array([dictCheck[i]["centroSinistra"] for i in dictCheck.keys()])
# # x2 = np.array([i for i in dictCheck.keys()])
# # cubic_interpolation_model = interp1d(x2, y2, kind="cubic")
# # x2_ = np.linspace(x2.min(), x2.max(), 200)
# # y2_ = cubic_interpolation_model(x2_)
# # plt.plot(x2_, y2_, color="r")

# y3 = np.array([dictCheck[i]["centroPuro"] for i in dictCheck.keys()])
# x3 = np.array([i for i in dictCheck.keys()])
# cubic_interpolation_model = interp1d(x3, y3, kind="cubic")
# x3_ = np.linspace(x3.min(), x3.max(), 200)
# y3_ = cubic_interpolation_model(x3_)
# plt.plot(x3_, y3_, color="g")

# # y5 = np.array([dictCheck[i]["altro"] for i in dictCheck.keys()])
# # x5 = np.array([i for i in dictCheck.keys()])
# # cubic_interpolation_model = interp1d(x5, y5, kind="cubic")
# # x5_ = np.linspace(x5.min(), x5.max(), 200)
# # y5_ = cubic_interpolation_model(x5_)
# # plt.plot(x5_, y5_, color="c")


# plt.title("Paragone evoluzione tra CDX e Centro Puro")
# plt.xlabel("Anno")
# plt.ylabel("Percentuale voti")
# plt.legend(["Centro Destra", "Centro Puro"])

# plt.show()
for key, value in dictCheck.items():
print(key, value)

dictCheck = dict(sorted(dictCheck.items()))

y = np.array([dictCheck[i]["centroDestra"] for i in dictCheck.keys()])
x = np.array([i for i in dictCheck.keys()])
cubic_interpolation_model = interp1d(x, y, kind="cubic")
x_ = np.linspace(x.min(), x.max(), 200)
y_ = cubic_interpolation_model(x_)
plt.plot(x_, y_, color="b")

y2 = np.array([dictCheck[i]["centroSinistra"] for i in dictCheck.keys()])
x2 = np.array([i for i in dictCheck.keys()])
cubic_interpolation_model = interp1d(x2, y2, kind="cubic")
x2_ = np.linspace(x2.min(), x2.max(), 200)
y2_ = cubic_interpolation_model(x2_)
plt.plot(x2_, y2_, color="r")

y3 = np.array([dictCheck[i]["centroPuro"] for i in dictCheck.keys()])
x3 = np.array([i for i in dictCheck.keys()])
cubic_interpolation_model = interp1d(x3, y3, kind="cubic")
x3_ = np.linspace(x3.min(), x3.max(), 200)
y3_ = cubic_interpolation_model(x3_)
plt.plot(x3_, y3_, color="g")

# y5 = np.array([dictCheck[i]["altro"] for i in dictCheck.keys()])
# x5 = np.array([i for i in dictCheck.keys()])
# cubic_interpolation_model = interp1d(x5, y5, kind="cubic")
# x5_ = np.linspace(x5.min(), x5.max(), 200)
# y5_ = cubic_interpolation_model(x5_)
# plt.plot(x5_, y5_, color="c")


plt.title("Evoluzione Generale")
plt.xlabel("Anno")
plt.ylabel("Percentuale voti")
plt.legend(["Centro Destra", "Centro Sinistra", "Centro Puro"])

plt.show()

0 comments on commit 7c77255

Please sign in to comment.