Sdílení vizualizací s ostatními

Introduction to Data Visualization with Matplotlib

Ariel Rokem

Data Scientist

Graf ke sdílení

fig, ax = plt.subplots()

ax.bar(medals.index, medals["Gold"])
ax.set_xticklabels(medals.index, rotation=90)
ax.set_ylabel("Number of medals")

plt.show()

Introduction to Data Visualization with Matplotlib

Uložení grafu do souboru

fig, ax = plt.subplots()

ax.bar(medals.index, medals["Gold"])
ax.set_xticklabels(medals.index, rotation=90)
ax.set_ylabel("Number of medals")

fig.savefig("gold_medals.png")
ls
gold_medals.png
Introduction to Data Visualization with Matplotlib

Různé formáty souborů

fig.savefig("gold_medals.jpg")
fig.savefig("gold_medals.jpg", quality=50)
fig.savefig("gold_medals.svg")
Introduction to Data Visualization with Matplotlib

Rozlišení

fig.savefig("gold_medals.png", dpi=300)
Introduction to Data Visualization with Matplotlib

Velikost

fig.set_size_inches([5, 3])

Introduction to Data Visualization with Matplotlib

Jiný poměr stran

fig.set_size_inches([3, 5])

Introduction to Data Visualization with Matplotlib

Procvičte si ukládání vizualizací!

Introduction to Data Visualization with Matplotlib

Preparing Video For Download...