Nhập môn Trực quan hóa Dữ liệu với Julia
Gustavo Vieira Suñe
Data Analyst
using Plots
# Đặt theme
theme(thm::Symbol; kwargs...)
thm): :default, :dark, :ggplot2, :juno, ...kwargs: đặt thuộc tính mặc địnhVí dụ: theme(:juno, linecolor=:red, linewidth=5)
showtheme(:ggplot2)

showtheme(:juno)

using DataFrames, CSV, Plots # Tải dữ liệu streaming = DataFrame(CSV.File("streaming.csv"))# Nhóm theo thể loại grouped = groupby(streaming, "Fav genre") # Đếm từng thể loại counts = combine(grouped, nrow => :count)
# Biểu đồ cột với :default bar( counts[!, "Fav genre"], counts.count,title="Favorite Music Genres" ylabel="Frequency", label=false, )

# Đặt theme theme(:juno)# Biểu đồ cột với :juno bar( counts[!, "Fav genre"], counts.count, label=false, ylabel="Frequency", title="Favorite Music Genres" )

theme( :juno,# Màu và độ dày đường mặc định linecolor=:red, linewidth=5,# Ẩn đường trục framestyle=:grid )bar( counts[!, "Fav genre"], counts.count, label=false, ylabel="Frequency", title="Favorite Music Genres" )

savefig("genres.png")Nhập môn Trực quan hóa Dữ liệu với Julia