Mercurial > repos > public > sbplib_julia
annotate sbpPlot.jl @ 995:1ba8a398af9c refactor/lazy_tensors
Rename types
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 18 Mar 2022 21:14:47 +0100 |
parents | d61bfc8cf6a5 |
children |
rev | line source |
---|---|
138
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
1 include("sbp.jl") |
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
2 using Makie |
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
3 import .sbp.Grid |
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
4 function plotgridfunction(grid::sbp.Grid.EquidistantGrid, gridfunction::AbstractArray) |
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
5 if sbp.Grid.dimension(grid) == 1 |
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
6 plot(sbp.Grid.pointsalongdim(grid,1), gridfunction) |
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
7 elseif sbp.Grid.dimension(grid) == 2 |
d61bfc8cf6a5
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
124
diff
changeset
|
8 scene = surface(sbp.Grid.pointsalongdim(grid,1),sbp.Grid.pointsalongdim(grid,2), gridfunction) |
124
631eb9b35d72
Make grid spacing a property of EquidistantGrid. Create plotting module for sbplib.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
9 else |
631eb9b35d72
Make grid spacing a property of EquidistantGrid. Create plotting module for sbplib.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
10 error(string("Plot not implemented for dimension ", string(dimension(grid)))) |
631eb9b35d72
Make grid spacing a property of EquidistantGrid. Create plotting module for sbplib.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
11 end |
631eb9b35d72
Make grid spacing a property of EquidistantGrid. Create plotting module for sbplib.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
12 end |