changeset 41:3d8bfb695497

Fix plotting issues in 2d
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 10 Jan 2019 16:48:49 +0100
parents 5ec57ec148ef
children c061d1bddba5
files grid.jl
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/grid.jl	Thu Jan 10 14:57:18 2019 +0100
+++ b/grid.jl	Thu Jan 10 16:48:49 2019 +0100
@@ -1,5 +1,6 @@
 module grid
-using PyPlot
+using Plots
+pyplot()
 
 abstract type Grid end
 
@@ -123,13 +124,17 @@
         X = repeat(x,1,grid.numberOfPointsPerDim[2])
         y = pointsalongdim(grid,2)
         Y = repeat(y,1,grid.numberOfPointsPerDim[1])'
+        surface(X,Y,reshape(gridfunction))
     elseif numberOfDimensions(grid) == 3
         x = pointsalongdim(grid,1)
         X = repeat(x,1,grid.numberOfPointsPerDim[2])
         y = pointsalongdim(grid,2)
         Y = repeat(y,1,grid.numberOfPointsPerDim[1])'
+        y = pointsalongdim(grid,2)
+        Y = repeat(y,1,grid.numberOfPointsPerDim[1])'
+        surface(X,Y,gridfunction)
     else
-        error(string("Plot not implemented for dimension =", string(dim)))
+        error(string("Plot not implemented for dimension ", string(dim)))
     end
 end