Mercurial > repos > public > sbplib_julia
changeset 59:60d575e4a2d8
Merge with latest changes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 16 Jan 2019 12:40:20 +0100 |
parents | f3ea15c8ebb6 (diff) c62ea0112d4d (current diff) |
children | 8a7a537f54e5 8cd8d83b92e7 |
files | |
diffstat | 1 files changed, 5 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/EquidistantGrid.jl Tue Jan 15 10:25:56 2019 +0100 +++ b/EquidistantGrid.jl Wed Jan 16 12:40:20 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