Introduction to Data Visualization with Julia
Gustavo Vieira Suñe
Data Analyst
# Set the theme theme(:bright)
# Create a scatter plot scatter( streaming.Age, streaming."Frequency [K pop]", group=streaming."Frequency [K pop]", label=false,
# Set color palette palette=:Dark2_5 )
xlabel!("Age") ylabel!("Frequency of Play")
Previously encountered:
title
, xlabel
, ylabel
xticks
, yticks
color
linecolor
, linewidth
markercolor
framestyle
Many more:
xlims
, ylims
alpha
linestyle
legend_title
, legend_position
markersize
, markershape
...
theme(:bright) scatter( streaming.Age, streaming."Frequency [K pop]", group=streaming."Frequency [K pop]", label=false, palette=:Dark2_5
# Marker attributes markershape=:diamond, markersize=8, )
xlabel!("Age") ylabel!("Frequency of Play")
theme(:bright) scatter( streaming.Age, streaming."Frequency [K pop]", group=streaming."Frequency [K pop]", label=false, palette=:Dark2_5 markershape=:diamond, markersize=8,
# Opacity alpha=0.25 )
xlabel!("Age") ylabel!("Frequency of Play")
# Set theme and default line width theme(:dao, linewidth=4)
# Create histogram histogram(streaming.BPM, label="Observed", color=:lightslateblue, normalize=true)
# Add density plot density!(streaming.BPM, label="Distribution", linecolor=:green2,
# Line style linestyle=:dash)
xlabel!("BPM") ylabel!("Probability")
theme(:dao, linewidth=4) histogram(streaming.BPM, label="Observed", color=:lightslateblue, normalize=true) density!(streaming.BPM, label="Distribution", linecolor=:green2, linestyle=:dash
# Customize legend legend_title="Type", legend_position=:topright)
# Set the x-axis bounds xlims!(50, 230)
xlabel!("BPM") ylabel!("Probability")
plot(..., palette=palette_symbol)
markersize
markershape
alpha=opacity_value
xlims!()
, ylims!()
Line attribute: linetyle
Legend attributes
legend_title
legend_position
(:right
, :left
, :top
, :bottom
, :topright
, :topleft
, ...)Introduction to Data Visualization with Julia