Mercurial > repos > public > sbplib_julia
comparison sbpPlot.jl @ 138:d61bfc8cf6a5 cell_based_test
Change from using PyPlot to Makie. Add ugly workaround in order to enable use of sbpPlot
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 21 Feb 2019 16:51:27 +0100 |
parents | 631eb9b35d72 |
children |
comparison
equal
deleted
inserted
replaced
137:99308f68e548 | 138:d61bfc8cf6a5 |
---|---|
1 module sbpPlot | 1 include("sbp.jl") |
2 using PyPlot, PyCall | 2 using Makie |
3 | 3 import .sbp.Grid |
4 function plotgridfunction(grid::EquidistantGrid, gridfunction) | 4 function plotgridfunction(grid::sbp.Grid.EquidistantGrid, gridfunction::AbstractArray) |
5 if dimension(grid) == 1 | 5 if sbp.Grid.dimension(grid) == 1 |
6 plot(pointsalongdim(grid,1), gridfunction, linewidth=2.0) | 6 plot(sbp.Grid.pointsalongdim(grid,1), gridfunction) |
7 elseif dimension(grid) == 2 | 7 elseif sbp.Grid.dimension(grid) == 2 |
8 mx = grid.size[1] | 8 scene = surface(sbp.Grid.pointsalongdim(grid,1),sbp.Grid.pointsalongdim(grid,2), gridfunction) |
9 my = grid.size[2] | |
10 X = repeat(pointsalongdim(grid,1),1,my) | |
11 Y = permutedims(repeat(pointsalongdim(grid,2),1,mx)) | |
12 plot_surface(X,Y,reshape(gridfunction,mx,my)); | |
13 else | 9 else |
14 error(string("Plot not implemented for dimension ", string(dimension(grid)))) | 10 error(string("Plot not implemented for dimension ", string(dimension(grid)))) |
15 end | 11 end |
16 end | 12 end |
17 end |