Visualisaties delen met anderen

Introductie tot datavisualisatie met Matplotlib

Ariel Rokem

Data Scientist

Een figuur om te delen

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()

Introductie tot datavisualisatie met Matplotlib

De figuur opslaan naar bestand

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
Introductie tot datavisualisatie met Matplotlib

Verschillende bestandsformaten

fig.savefig("gold_medals.jpg")
fig.savefig("gold_medals.jpg", quality=50)
fig.savefig("gold_medals.svg")
Introductie tot datavisualisatie met Matplotlib

Resolutie

fig.savefig("gold_medals.png", dpi=300)
Introductie tot datavisualisatie met Matplotlib

Formaat

fig.set_size_inches([5, 3])

Introductie tot datavisualisatie met Matplotlib

Een andere beeldverhouding

fig.set_size_inches([3, 5])

Introductie tot datavisualisatie met Matplotlib

Oefen met het opslaan van je visualisaties!

Introductie tot datavisualisatie met Matplotlib

Preparing Video For Download...