Data Science Applications to Astronomy
Week 10: Data Visualization:
Q&A
Plots
We saw a table of 15 fonts to write “phi,” is there a font for greek letters that’s used most often in figures or papers?
using LaTeXStrings
L"$\phi"begin
n = 50
x = rand(n)
y = 4 .* x + randn(n)
end;
scatter(x,y, xlabel="Unicode: Φ or ϕ", ylabel=L"\mathrm{LaTeX:}\;\; \Phi \; or\; \phi", legend=:none)
For the scatter plot in the lab this week, how could we have made the points partly transparent?
scatter(x,y, alpha=0.5)scatter(x,y, alpha=plt_α, markerstrokewidth=0)
Transparency ("alpha"):
Is there another type of plot to show the density of data that is not a contour plot?
let
m = 40
z = randn(n,m)
z = (1:n)' * 1 .+ 0.5.* randn(m)
heatmap(1:n, 1:m, z,
c=:diverging_bwr_20_95_c54_n256,
xlabel="x", ylabel="y",
title="Heatmap")
end
Are there certain colors/combination of colors that should be avoided when presenting visuals?
Color pairs hard for people with CVD
Red & Green (most common)
Blue & Green and Yellow & Red
Just look bad (very subjective)
Yellow & Green
Brown & Orange
Multiple neon colors
Hard to distinguish
Yellow & Orange
Black & Navy blue
Cross validation
question_box(md"Can you explain k-fold again please?")
Can you explain k-fold again please?
K in K-fold Validation:
Setup
Built with Julia 1.11.5 and
ColorSchemes 3.29.0LaTeXStrings 1.4.0
MLUtils 0.4.7
Plots 1.40.9
PlutoTeachingTools 0.3.1
PlutoUI 0.7.61
To run this tutorial locally, download this file and open it with Pluto.jl.