Skip to content

Commit

Permalink
Merge pull request #43 from MakieOrg/fix_rasters_example
Browse files Browse the repository at this point in the history
up rasters
  • Loading branch information
lazarusA authored Jan 7, 2024
2 parents 41b498b + 07d9181 commit 6a8fd7c
Show file tree
Hide file tree
Showing 91 changed files with 489 additions and 300 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ jobs:
- name: Install documentation dependencies
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs -e 'using Pkg; pkg"add https://github.com/LuxDL/DocumenterVitepress.jl.git"; Pkg.instantiate(); Pkg.precompile()'
- name: generating examples md files
run: |
julia --project=docs/ --color=yes docs/gen_mds.jl
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ --color=yes docs/make.jl
- name: Build with VitePress
env:
RASTERDATASOURCES_PATH: ".." # For downloading raster data
JULIA_DEBUG: "Documenter"
DATADEPS_ALWAYS_ACCEPT: true
run: |
julia --project=docs/ --color=yes docs/gen_mds.jl
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ --color=yes docs/make.jl
- name: Build with VitePress
run: |
NODE_OPTIONS=--max-old-space-size=32768 npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
touch docs/docs_site/.vitepress/dist/.nojekyll
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ docs/src/examples
.cache
dev
test_record
node_modules
node_modules
tmp_*
1 change: 0 additions & 1 deletion docs/gen_mds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function get_files(folders)
"world_energy.jl",
"gapminder.jl",
"gott_azimuthal.jl",
"rasters.jl",
"density_ridges.jl",
"penguins.jl",
"penguins3d.jl",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const viteConfig = defineViteConfig({
{ text: 'stairs',link: '/examples/2d/stairs/stairs' },
{ text: 'stem',link: '/examples/2d/stem/stem' },
{ text: 'streamplot',link: '/examples/2d/streamplot/streamplot' },
{ text: 'text',link: '/examples/2d/text/name' },
{ text: 'text',link: '/examples/2d/text/your_name' },
{ text: 'violins',link: '/examples/2d/violins/single' },
]},

Expand All @@ -82,7 +82,7 @@ const viteConfig = defineViteConfig({
{ text: 'Dashboards', link: '/examples/dashboards/tesseral_spherical_harmonics' },
{ text: 'Data Visualization', link: '/examples/datavis/earthquakes' },
{ text: 'Geo', link: '/examples/geo/projections' },
{ text: 'Algebra of Graphics', link: '/examples/aog/penguins3d' },
{ text: 'Algebra of Graphics', link: '/examples/aog/ablines' },
{ text: 'Raytracing', link: '' }
]},
{ text: 'Pkgs versions', link: '/pkgs_versions' },
Expand Down
8 changes: 5 additions & 3 deletions examples/2d/arrows/arrows.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## Arrows

# ![](arrows.svg)

using CairoMakie
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -17,6 +21,4 @@ Colorbar(fig[1,2], limits =(minimum(strength), maximum(strength)),
limits!(ax, -3,3,-3,3)
colsize!(fig.layout, 1, Aspect(1, 1.0))
fig
save("arrows.svg", fig); # hide

# ![](arrows.svg)
save("arrows.svg", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/band/band.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## band

# ![](band.svg)

using CairoMakie, Random
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -21,6 +25,4 @@ ylims!(-0.55,1)
axislegend(ax, position = :rt, merge = true)
hidedecorations!(ax; grid = false)
fig
save("band.svg", fig); # hide

# ![](band.svg)
save("band.svg", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/band/band_confidence_error.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## band confidence error

# ![](band_confidence_error.svg)

using CairoMakie
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -11,6 +15,4 @@ ax = Axis(fig[1, 1], xlabel = "x", ylabel = "y")
lines!(x, y1d, color = :black)
band!(x, lower, upper; color = (:green, 0.2))
fig
save("band_confidence_error.svg", fig); # hide

# ![](band_confidence_error.svg)
save("band_confidence_error.svg", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/band/band_ribbon.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## band or ribbon

# ![](band_ribbon.svg)

using CairoMakie
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -7,6 +11,4 @@ ax = Axis(fig[1, 1], xlabel = "x", ylabel = "y")
band!(x, sin.(x), sin.(x) .+ 1; color = (:blue, 0.2))
band!(x, cos.(x), 1 .+ cos.(x); color = (:red, 0.2))
fig
save("band_ribbon.svg", fig); # hide

# ![](band_ribbon.svg)
save("band_ribbon.svg", fig); # hide
4 changes: 4 additions & 0 deletions examples/2d/band/filled_under.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## Filled Under

# ![](filled_under.svg)

using CairoMakie
CairoMakie.activate!(type = "svg") #hide

Expand Down
8 changes: 5 additions & 3 deletions examples/2d/band/filled_under_bell.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## Filled curve. Under the bell

# ![](filled_under_bell.svg)

using CairoMakie
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -16,6 +20,4 @@ for (idx, μ) in enumerate(μs)
end
axislegend(; merge = true, framecolor = :red)
fig
save("filled_under_bell.svg", fig); # hide

# ![](filled_under_bell.svg)
save("filled_under_bell.svg", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/bars/barplot_cmap_y_error.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## barplot with colormap and y-errorbars

# ![](barplot_cmap_y_error.svg)

using CairoMakie, Random
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -9,6 +13,4 @@ barplot!(ax, x, y; strokewidth = 1, color = x, colormap = (:Spectral_10, 0.85),
strokecolor = :black)
errorbars!(ax, x, y, yerr; whiskerwidth = 12)
fig
save("barplot_cmap_y_error.svg", fig); # hide

# ![](barplot_cmap_y_error.svg)
save("barplot_cmap_y_error.svg", fig); # hide
7 changes: 4 additions & 3 deletions examples/2d/bars/barplot_y_error.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ## barplot and y-errorbars
# ![](band_y_error.svg)

using CairoMakie, Random
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -9,6 +12,4 @@ ax = Axis(fig[1, 1], xlabel = "variable", ylabel = "values")
barplot!(ax, x, y; strokewidth = 1, color = :transparent, strokecolor = :black)
errorbars!(ax, x, y, yerr; whiskerwidth = 12)
fig
save("band_y_error.svg", fig); # hide

# ![](band_y_error.svg)
save("band_y_error.svg", fig); # hide
10 changes: 5 additions & 5 deletions examples/2d/bars/stripped_bars.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# ## stripped bars

# ![](stripped_bars.png)

## This currently fails with CairoMakie
## https://discourse.julialang.org/t/striped-colors-for-e-g-bar-plots-in-julia/64435/3
using GLMakie.Makie, GLMakie, Random
GLMakie.activate!()
GLMakie.closeall() # close any open screen


Random.seed!(13)
## patterns
## `'/'`, `'\\'`, `'-'`, `'|'`, `'x'`, and `'+'`
Expand All @@ -23,6 +25,4 @@ for (idx, pattern) in enumerate(patternColors)
end
ax.xticks = (1:8, ["grey", "orange", "/", "\\", "-", "|", "x", "+"])
fig
save("stripped_bars.png", fig); # hide

# ![](stripped_bars.png)
save("stripped_bars.png", fig); # hide
7 changes: 4 additions & 3 deletions examples/2d/bars/x_barplot_error_y_error.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ## x-error barplot and y-errorbars
# ![](x_barplot_error_y_error.svg)

using CairoMakie, Random
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -10,6 +13,4 @@ barplot!(ax, x, y; width = 1.8xerr, strokewidth = 1, color = :transparent,
strokecolor = :black)
errorbars!(ax, x, y, yerr; whiskerwidth = 12)
fig
save("x_barplot_error_y_error.svg", fig); # hide

# ![](x_barplot_error_y_error.svg)
save("x_barplot_error_y_error.svg", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/boxplots/airquality.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## boxplots for airquality data

# ![](airquality.svg)

using CairoMakie, RDatasets, Colors, ColorSchemes
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -15,6 +19,4 @@ for (indx, f) in enumerate(categories)
mediancolor = :black)
end
fig
save("airquality.svg", fig); # hide

# ![](airquality.svg)
save("airquality.svg", fig); # hide
7 changes: 5 additions & 2 deletions examples/2d/boxplots/boxplots_collection.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## boxplot collection: Normal distributions

# ![](boxplot_collection.svg)

using CairoMakie, Random, Distributions
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -23,5 +27,4 @@ for i in 2:7
end
axislegend(ax, position = :lt)
fig
save("boxplot_collection.svg", fig); # hide
# ![](boxplot_collection.svg)
save("boxplot_collection.svg", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/boxplots/vertical_horizontal.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## vertical and horizontal boxplots

# ![](vertical_horizontal.svg)

using CairoMakie, Random
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -23,6 +27,4 @@ limits!(ax2, -5, 5, 0, 2)
axislegend(ax1, position = :rb, framecolor = :transparent)
axislegend(ax2, position = :rt, backgroundcolor = (:dodgerblue, 0.2))
fig
save("vertical_horizontal.svg", fig); # hide

# ![](vertical_horizontal.svg)
save("vertical_horizontal.svg", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/contour/complex_function.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## contour plots at levels

# ![](contour_function.png)

using CairoMakie
CairoMakie.activate!(type = "png") #hide

Expand All @@ -18,6 +22,4 @@ Colorbar(fig[1, 3], pltobj1, ticks=([-π, -π / 2, 0, π / 2, π],
["", "-π/2", "0", "π/2", "π"]))
limits!(axs[1], -2, 2, -2, 2)
fig
save("contour_function.png", fig); # hide

# ![](contour_function.png)
save("contour_function.png", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/contour/contour_over_heatmap.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## contour over heatmap

# ![](contour_over_heatmap.png)

using CairoMakie
CairoMakie.activate!(type = "png") #hide

Expand All @@ -17,6 +21,4 @@ Colorbar(fig[1, 4], p1, width=20, ticksize=20, tickalign=1)
[hideydecorations!(axs[i], grid=false, ticks=false) for i in 2:3]
fig

save("contour_over_heatmap.png", fig); # hide

# ![](contour_over_heatmap.png)
save("contour_over_heatmap.png", fig); # hide
8 changes: 5 additions & 3 deletions examples/2d/contour/egg_shape.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ## contour levels: egg shape

# ![](egg_shape.png)

using CairoMakie, Random
CairoMakie.activate!(type = "png") #hide
x = -1:0.02:1
Expand All @@ -18,6 +22,4 @@ cl = contour!(x, y, segg;
## colsize!(fig.layout, 1, Aspect(1, 0.6))
fig

save("egg_shape.png", fig); # hide

# ![](egg_shape.png)
save("egg_shape.png", fig); # hide
7 changes: 4 additions & 3 deletions examples/2d/contour/overlayed_functions.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# ## Multiple overlayed contour plots

# ![](overlayed_functions.svg)

using CairoMakie
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -19,6 +22,4 @@ contour!(ax, x, y, zg; labels=true, color=:dodgerblue, linewidth=2,
axislegend()
fig

save("overlayed_functions.svg", fig); # hide

# ![](overlayed_functions.svg)
save("overlayed_functions.svg", fig); # hide
7 changes: 4 additions & 3 deletions examples/2d/contour/qubit.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ## contour levels: qubit
# ![](qubit.png)

using CairoMakie
CairoMakie.activate!(type = "png") #hide

Expand All @@ -14,6 +17,4 @@ cls = contour!(ψ1, ψ2, z; colormap=:plasma, levels=20, linewidth=1.5)
limits!(ax, 0, 4π, 0, 4π)
## colsize!(fig.layout, 1, Aspect(1, 1.0))

save("qubit.png", fig); # hide

# ![](qubit.png)
save("qubit.png", fig); # hide
7 changes: 4 additions & 3 deletions examples/2d/density/density.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ## density plot

# ![](density.svg)
using CairoMakie, Distributions, Random
CairoMakie.activate!(type = "svg") #hide

Expand All @@ -15,6 +18,4 @@ for (idx, μσ) in enumerate(μσpairs)
end
axislegend(L"\mu,\quad\sigma"; position= :cb, titlesize= 22)
hidedecorations!(ax; grid = false);
save("density.svg", fig); # hide

# ![](density.svg)
save("density.svg", fig); # hide
Loading

0 comments on commit 6a8fd7c

Please sign in to comment.