changeset 58:f3ea15c8ebb6

Clean up plotgridfunction now that the matplotlib backend works. The issue was not in the julia code, but rather the installation of matplotlib.
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 16 Jan 2019 12:39:42 +0100
parents 8c6db1f6d8e0
children 60d575e4a2d8
files EquidistantGrid.jl
diffstat 1 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/EquidistantGrid.jl	Mon Jan 14 11:30:36 2019 +0100
+++ b/EquidistantGrid.jl	Wed Jan 16 12:39:42 2019 +0100
@@ -96,25 +96,17 @@
 end
 
 using PyPlot, PyCall
-#pygui(:qt)
-#using Plots; pyplot()
 
 function plotgridfunction(grid::EquidistantGrid, gridfunction)
     if numberOfDimensions(grid) == 1
         plot(pointsalongdim(grid,1), gridfunction, linewidth=2.0)
     elseif numberOfDimensions(grid) == 2
-        mx = grid.numberOfPointsPerDim[1];
-        my = grid.numberOfPointsPerDim[2];
-        x = pointsalongdim(grid,1)
-        X = repeat(x,1,my)
-        y = pointsalongdim(grid,2)
-        Y = permutedims(repeat(y,1,mx))
-        plot_surface(X,Y,reshape(gridfunction,mx,my))
-        # fig = figure()
-        # ax = fig[:add_subplot](1,1,1, projection = "3d")
-        # ax[:plot_surface](X,Y,reshape(gridfunction,mx,my))
+        mx = grid.numberOfPointsPerDim[1]
+        my = grid.numberOfPointsPerDim[2]
+        X = repeat(pointsalongdim(grid,1),1,my)
+        Y = permutedims(repeat(pointsalongdim(grid,2),1,mx))
+        plot_surface(X,Y,reshape(gridfunction,mx,my));
     else
         error(string("Plot not implemented for dimension ", string(numberOfDimensions(grid))))
     end
-    savefig("gridfunction")
 end