Introductie tot datavisualisatie met Julia
Gustavo Vieira Suñe
Data Analyst
kerala DataFrame:| Date | Centre | Commodity | Price |
|---|---|---|---|
| JAN-2001 | Ernakulam | Onion | 10.0 |
| JAN-2001 | Ernakulam | Wheat | 12.5 |
| JAN-2001 | Khozhikode | Onion | 9.0 |
| JAN-2001 | Khozhikode | Wheat | 14.0 |
| ... | ... | ... | ... |
| MAR-2021 | Trivandrum | Onion | 45.0 |
| MAR-2021 | Trivandrum | Wheat | 34.0 |
| Commodity | Mean Price |
|---|---|
| Onion | 25.7442 |
| Wheat | 20.6261 |

# Teken een histogram histogram( kerala[:, :Price],# Voeg een label toe label="Onion and Wheat", # Kies balkkleur color=:darkseagreen1, )# Aslabels xlabel!("Price (Rupees)") ylabel!("Frequency")

# Teken een histogram histogram( kerala[:, :Price], # Voeg een label toe label="Onion and Wheat", # Kies balkkleur color=:darkseagreen1,# Aantal bins bins=20, ) # Aslabels xlabel!("Price (Rupees)") ylabel!("Frequency")

# Teken een histogram
histogram(
kerala[:, :Price],
# Voeg een label toe
label="Onion and Wheat",
# Kies balkkleur
color=:darkseagreen1,
# Aantal bins
bins=range(0, 150, 75),
)
# Aslabels
xlabel!("Price (Rupees)")
ylabel!("Frequency")

# Teken een genormaliseerd histogram histogram( kerala[:, :Price], # Voeg een label toe label="Onion and Wheat", # Kies balkkleur color=:darkseagreen1,# Normaliseer normalize=true, ) # Aslabels xlabel!("Price (Rupees)") ylabel!("Probability")

using StatsPlotsdensity!( kerala[:, :Price], color=:black, linewidth=3, label=false )

using StatsPlots # Gegroepeerd histogram groupedhist( kerala[:, :Price],# Groepeer op product group=kerala[:, "Commodity"],# Kies kleuren color=[:deeppink3 :wheat2] ) xlabel!("Price (Rupees)") ylabel!("Frequency")

using StatsPlots # Gestapeld histogram groupedhist( kerala[:, :Price], # Groepeer op product group=kerala[:, "Commodity"], # Kies kleuren color=[:deeppink3 :wheat2]# Stapel de balken bar_position=:stack, )xlabel!("Price (Rupees)") ylabel!("Frequency")


| Commodity | Mean Price |
|---|---|
| Onion | 25.7442 |
| Wheat | 20.6261 |
| Commodity | Median Price |
|---|---|
| Onion | 20.0 |
| Wheat | 19.5 |
Introductie tot datavisualisatie met Julia