Pengantar Visualisasi Data dengan Julia
Gustavo Vieira Suñe
Data Analyst
# Violin plot @df insurance violin( :Sex, :Charges, label=false, linewidth=0, fillcolor=:grey40 )# Tambahkan box plot @df insurance boxplot!( :Sex, :Charges, label=false, alpha=0.75, fillcolor=:mediumorchid3, outliers=false, ) ylabel!("Premi Asuransi (USD)")

insurance| Age | Sex | BMI | Children | Smoker | Region | Charges |
|---|---|---|---|---|---|---|
| 19 | female | 27.90 | 0 | yes | southwest | 16884.90 |
| 18 | male | 33.77 | 1 | no | southeast | 1725.55 |
| 28 | male | 33.00 | 3 | no | southeast | 4449.46 |
| ... | ... | ... | ... | ... | ... | ... |
@df kompatibel dengan argumen layout!@df insurance violin( :Sex, :Charges, group=:Region, linewidth=0, color=[:red :green :blue :purple], legend_position=:top,# Atur tata letak layout=(2,2)) ylims!(0, 6*10^4) ylabel!("Premi (USD)")

@chain insurance begin # Kolom Smoker ke numerik transform(:Smoker => ByRow(x -> x == "yes" ? 100 : 0) => :Smoker)groupby([:Sex, :Children]) combine(:Smoker => mean)@df bar(:Children, :Smoker_mean, group=:Sex, linewidth=0, fillcolor=[:cyan4 :chocolate2], # Atur tata letak layout=2)end ylims!(0, 35) xlabel!("Children") ylabel!("Persentase Perokok")



Diagonal
Di atas diagonal
Di bawah diagonal
# Menggunakan resep DataFrames @df insurance corrplot(# Kolom numerik [:Age :BMI],# Kustomisasi markercolor=:thermal, fillcolor=:acton )

# Menggunakan resep DataFrames @df insurance corrplot( # Kolom numerik [:Age :BMI :Children :Charges],# Kustomisasi markercolor=:thermal, fillcolor=:acton )

Pengantar Visualisasi Data dengan Julia