Skip to content

Instantly share code, notes, and snippets.

@svilupp
Created August 5, 2022 09:38
Show Gist options
  • Save svilupp/25c02a7f347a63c99e61e5112b9ca6b8 to your computer and use it in GitHub Desktop.
Save svilupp/25c02a7f347a63c99e61e5112b9ca6b8 to your computer and use it in GitHub Desktop.
Target file to create from Literate.jl
---
title: "Plots Demo"
author: "Norah Jones"
date: "5/22/2021"
format:
html:
toc: true
toc-depth: 2
code-fold: true
self-contained: true
jupyter: julia-1.7
---
```{julia}
#| echo: false
#| output: false
using Pkg; Pkg.activate(".")
```
# Parametric Plots
Plot function pair (x(u), y(u)).
See @fig-parametric for an example.
```{julia}
#| label: fig-parametric
#| fig-cap: "Parametric Plots"
using Plots
using StatsBase
using PrettyTables
plot(sin,
x->sin(2x),
0,
2π,
leg=false,
fill=(0,:lavender))
```
# Calculation
```{julia}
# Calculate average number
rand(1:100) |> mean
```
# Pretty Table
```{julia}
data = [1 2 3; 4 5 6];
pretty_table(data; header = ["Column 1", "Column 2", "Column 3"])
```
# ---
# title: "Plots Demo"
# author: "Norah Jones"
# date: "5/22/2021"
# format:
# html:
# toc: true
# toc-depth: 2
# code-fold: true
# self-contained: true
# jupyter: julia-1.7
# ---
##| echo: false
##| output: false
using Pkg; Pkg.activate(".")
# # Parametric Plots
# Plot function pair (x(u), y(u)).
# See @fig-parametric for an example.
##| label: fig-parametric
##| fig-cap: "Parametric Plots"
using Plots
using StatsBase
using PrettyTables
plot(sin,
x->sin(2x),
0,
2π,
leg=false,
fill=(0,:lavender))
# # Calculation
# Calculate average number
rand(1:100) |> mean
# # Pretty Table
data = [1 2 3; 4 5 6];
pretty_table(data; header = ["Column 1", "Column 2", "Column 3"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment