Chapter 6. Data Visualization in Julia
import Pkg;
Pkg.add(["Tidier", "TidierData", "TidierText", "TidierStrings", "TidierPlots", "DataFrames", "CSV", "Pipelines", "Makie", "StatsPlots", "RDatasets"]);
using Tidier, TidierData, TidierText, TidierStrings, TidierPlots, DataFrames, CSV, Pipelines, Makie, StatsPlots, RDatasets
import Makie.IntervalsBetween, Makie.Attributes
TidierPlots_set("plot_log", false) # I don't not want to see many logs
TidierPlots_set("plot_show", false) # and repetitive plots in VSCode[32m[1m Resolving[22m[39m package versions...
[32m[1m No Changes[22m[39m to `~/.julia/environments/v1.11/Project.toml`
[32m[1m No Changes[22m[39m to `~/.julia/environments/v1.11/Manifest.toml`
falseLoad Data
df = dataset("datasets", "iris")
first(df, 5)5×5 DataFrame
Row
SepalLength
SepalWidth
PetalLength
PetalWidth
Species
Float64
Float64
Float64
Float64
Cat…
1
5.1
3.5
1.4
0.2
setosa
2
4.9
3.0
1.4
0.2
setosa
3
4.7
3.2
1.3
0.2
setosa
4
4.6
3.1
1.5
0.2
setosa
5
5.0
3.6
1.4
0.2
setosa
Basic Plots
1. Scatter Plot

2. Bar Plot

3. Line Plot

4. Histogram

Color and themes
1. Color

2. Themes

Facet

However, the supports of ggplot-like visualization cannot be identical to that of ggplot2 in R.
If you want to use R packages or Python packages for certain purposes, we can also simply use them in Julia
PreviousChatpter 5 (cont.). Advanced Causal Inference in JuliaNextChapter 7. Using R and Python in Julia
Last updated
Was this helpful?