Code
using GLMakie,CSV,DataFrames,GLMakie,LinearAlgebra,Pipe
ref csv
using GLMakie,CSV,DataFrames,GLMakie,LinearAlgebra,Pipe
=["Height","Weight","Bodyfat"]
feature=@pipe CSV.File("./data/BodyFat.csv")|>DataFrame|>dropmissing|>select(_,feature)
datafirst(data,10)
Row | Height | Weight | Bodyfat |
---|---|---|---|
Float64 | Float64 | Float64 | |
1 | 73.5 | 247.25 | 32.3 |
2 | 71.5 | 177.25 | 22.5 |
3 | 69.0 | 156.25 | 22.0 |
4 | 67.75 | 154.25 | 12.3 |
5 | 70.0 | 177.0 | 20.5 |
6 | 72.0 | 198.0 | 22.6 |
7 | 71.5 | 200.5 | 28.7 |
8 | 70.25 | 163.0 | 21.3 |
9 | 71.5 | 241.25 | 29.9 |
10 | 71.0 | 218.5 | 21.3 |
function plot_bubble()
=Figure()
fig=Axis(fig[1,1];title="Bubble size: BodyFat",xlabel="$(feature[1])",ylabel="$(feature[2])")
axBox(fig[1,1];color = (:orange,0.1),strokewidth=0.5)
scatter!(ax,data[!,1],data[!,2],markersize=data[!,3].*2,color=(:blue,0.2),strokewidth=3,strokecolor=:black)
fig#save("Bubble-size-BodyFat.png",fig)
end
plot_bubble()