This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Makie | |
using AbstractPlotting | |
using FileIO, Colors | |
# Load World Ocean Atlas 2D fields for PO₄, Si(OH)₄, and NO₄ | |
using WorldOceanAtlasTools | |
lat, lon, PO₄_2D = WorldOceanAtlasTools.WOA13_surface_map("p", 0, "1°") | |
lat, lon, NO₄_2D = WorldOceanAtlasTools.WOA13_surface_map("n", 0, "1°") | |
lat, lon, SiOH₄_2D = WorldOceanAtlasTools.WOA13_surface_map("i", 0, "1°") | |
# Add the image layer to each plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using AIBECS, Plots | |
grd, TOCIM1 = OCIM1.load() | |
T(p) = TOCIM1 | |
function G(x,p) | |
@unpack τ, z₀ = p | |
return @. 1 - x / τ * (z < z₀) | |
end | |
z = depthvec(grd) | |
F, ∇ₓF = state_function_and_Jacobian(T, G) | |
struct IdealAgeParameters{U} <: AbstractParameters{U} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Luxor, Colors | |
function main(fname) | |
Drawing(600, 600, fname) | |
origin() | |
circle(O, 290, :clip) | |
sethue("white") | |
paint() | |
colors = [Luxor.julia_blue, Luxor.julia_red, Luxor.julia_green, Luxor.julia_purple] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using AIBECS, ModelingToolkit, LinearAlgebra | |
# dispatch for sparse matrices | |
Base.:*(A::SparseMatrixCSC{Operation,S}, x::StridedVector{Operation}) where {S} = | |
(T = Operation; mul!(similar(x, T, A.m), A, x, true, false)) | |
Base.:*(A::SparseMatrixCSC{Tx,S}, x::StridedVector{Operation}) where {Tx,S} = | |
(T = LinearAlgebra.promote_op(LinearAlgebra.matprod, Operation, Tx); mul!(similar(x, T, A.m), A, x, true, false)) | |
Base.:*(A::SparseMatrixCSC{Operation,S}, x::StridedVector{Tx}) where {Tx,S} = | |
(T = LinearAlgebra.promote_op(LinearAlgebra.matprod, Operation, Tx); mul!(similar(x, T, A.m), A, x, true, false)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using HTTP, CSV, Plots, DataFrames, Dates | |
# Download the data | |
df = CSV.read(IOBuffer(String(HTTP.get("https://covid.ourworldindata.org/data/total_cases.csv").body)), normalizenames=true) | |
# Plotting function | |
function doit(df, countries, alignment) | |
cp = get_color_palette(:auto, plot_color(:white), length(countries)) | |
plot(legend=false) | |
for (i,country) in enumerate(countries) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NEIGHBORS_MAP = { | |
0: (0, 0, 0, 0, 1, 0, 1, 0, 0, 0), | |
1: (0, 0, 0, 0, 0, 0, 1, 0, 1, 0), | |
2: (0, 0, 0, 0, 0, 0, 0, 1, 0, 1), | |
3: (0, 0, 0, 0, 1, 0, 0, 0, 1, 0), | |
4: (1, 0, 0, 1, 0, 0, 0, 0, 0, 1), | |
5: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0), | |
6: (1, 1, 0, 0, 0, 0, 0, 1, 0, 0), | |
7: (0, 0, 1, 0, 0, 0, 1, 0, 0, 0), | |
8: (0, 1, 0, 1, 0, 0, 0, 0, 0 ,0), |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using AbstractPlotting | |
using MakieLayout | |
using GLMakie; GLMakie.activate!() | |
GLMakie.GLFW.WindowHint(GLMakie.GLFW.FLOATING, 1) | |
using LinearAlgebra | |
## | |
scene = Scene(center = false, raw = true, resolution = (800, 800)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just trying stuff |