comparison sbpPlot.jl @ 134:79699dda29be

Merge in cell_based_test
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 21 Feb 2019 16:27:28 +0100
parents 631eb9b35d72
children d61bfc8cf6a5
comparison
equal deleted inserted replaced
84:48079bd39969 134:79699dda29be
1 module sbpPlot
2 using PyPlot, PyCall
3
4 function plotgridfunction(grid::EquidistantGrid, gridfunction)
5 if dimension(grid) == 1
6 plot(pointsalongdim(grid,1), gridfunction, linewidth=2.0)
7 elseif dimension(grid) == 2
8 mx = grid.size[1]
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
14 error(string("Plot not implemented for dimension ", string(dimension(grid))))
15 end
16 end
17 end