diff --git a/2D Burgers Equation.py b/2D Burgers Equation.py index 0000472..df19721 100644 --- a/2D Burgers Equation.py +++ b/2D Burgers Equation.py @@ -48,7 +48,7 @@ print(lineSingle) fig = pyplot.figure(figsize=(11,7),dpi=100) #Initializing the figure -ax = fig.gca(projection='3d') +ax = fig.add_subplot(projection = '3d') X,Y = numpy.meshgrid(x,y) ax.plot_surface(X,Y,u[:],cmap=cm.viridis,rstride=1,cstride=1) @@ -98,7 +98,7 @@ print(lineSingle) fig = pyplot.figure(figsize=(11,7),dpi=100) -ax = fig.gca(projection='3d') +ax = fig.add_subplot(projection = '3d') X,Y = numpy.meshgrid(x,y) ax.plot_surface(X,Y,u[:],cmap=cm.viridis,rstride=1,cstride=1) diff --git a/2D Diffusion Equation.py b/2D Diffusion Equation.py index 2d987f8..31650c8 100644 --- a/2D Diffusion Equation.py +++ b/2D Diffusion Equation.py @@ -40,7 +40,7 @@ fig = pyplot.figure() -ax = fig.gca(projection='3d') +ax = fig.add_subplot(projection = '3d') X,Y = numpy.meshgrid(x, y) surf = ax.plot_surface(X,Y,u, rstride=1, cstride=1, cmap=cm.viridis, linewidth=0, antialiased=False) @@ -79,7 +79,7 @@ print(lineSingle) fig = pyplot.figure() -ax = fig.gca(projection='3d') +ax = fig.add_subplot(projection = '3d') surf = ax.plot_surface(X,Y,u[:], rstride=1, cstride=1, cmap=cm.viridis,linewidth=0, antialiased=True) ax.set_zlim(1, 2.5) diff --git a/2D Laplace Equation.py b/2D Laplace Equation.py index 500fdcd..b64f1a0 100644 --- a/2D Laplace Equation.py +++ b/2D Laplace Equation.py @@ -11,7 +11,7 @@ def plot2D(x, y, p): fig = pyplot.figure(figsize=(11,7),dpi=100) - ax = fig.gca(projection='3d') + ax = fig.add_subplot(projection = '3d') X,Y=numpy.meshgrid(x,y) #Generating 2D Mesh diff --git a/2D Linear Convection Equation .py b/2D Linear Convection Equation .py index dd9fa9f..38fb84d 100644 --- a/2D Linear Convection Equation .py +++ b/2D Linear Convection Equation .py @@ -47,7 +47,7 @@ print(lineSingle) fig = pyplot.figure(figsize=(11, 7), dpi=100) #innitilize plot window -ax = fig.gca(projection = '3d') #defining axis is 3d +ax = fig.add_subplot(projection = '3d') #defining axis is 3d X,Y = numpy.meshgrid(x, y) #Generating 2D Mesh #assign plot window the axes label ax, specifies its 3d projection plot @@ -95,7 +95,7 @@ print(lineSingle) fig = pyplot.figure(figsize=(11,7), dpi=100) -ax = fig.gca(projection = '3d') +ax = fig.add_subplot(projection = '3d') surf2 = ax.plot_surface(X, Y, u[:], cmap=cm.viridis) ax.set_title('Method - I:Using Nested FOR Loop') ax.set_xlabel('X Spacing') @@ -133,7 +133,7 @@ print(lineSingle) fig = pyplot.figure(figsize=(11,7), dpi = 100) -ax = fig.gca(projection = '3d') +ax = fig.add_subplot(projection = '3d') surf3 = ax.plot_surface(X, Y, u[:], cmap = cm.viridis) ax.set_title('Method - II: Using ARRAYS Operation') ax.set_xlabel('X Spacing') diff --git a/2D Non Linear Convection Equation .py b/2D Non Linear Convection Equation .py index e5da1f1..4cc811a 100644 --- a/2D Non Linear Convection Equation .py +++ b/2D Non Linear Convection Equation .py @@ -42,7 +42,7 @@ print(lineSingle) fig = pyplot.figure(figsize=(11, 7), dpi = 100) -ax = fig.gca(projection = '3d') +ax = fig.add_subplot(projection = '3d') X,Y = numpy.meshgrid(x, y) #Generating 2D Mesh ax.plot_surface(X, Y, u[:],cmap=cm.viridis, rstride=2, cstride=2) @@ -83,7 +83,7 @@ print(lineSingle) fig = pyplot.figure(figsize=(11, 7), dpi = 100) -ax = fig.gca(projection = '3d') +ax = fig.add_subplot(projection = '3d') X,Y = numpy.meshgrid(x, y) ax.plot_surface(X, Y, u[:],cmap=cm.viridis, rstride=2, cstride=2) diff --git a/2D Poisson Equation.py b/2D Poisson Equation.py index 759b4b5..04afd6a 100644 --- a/2D Poisson Equation.py +++ b/2D Poisson Equation.py @@ -45,7 +45,7 @@ def plot2D(x, y, p): fig = pyplot.figure(figsize=(11, 7), dpi=100) - ax = fig.gca(projection='3d') + ax = fig.add_subplot(projection = '3d') #Generating 2D Mesh X, Y = numpy.meshgrid(x, y) @@ -96,7 +96,7 @@ def plot2D(x, y, p): def plot2D(x, y, p): fig = pyplot.figure(figsize=(11, 7), dpi=100) - ax = fig.gca(projection='3d') + ax = fig.add_subplot(projection = '3d') X, Y = numpy.meshgrid(x, y) #Generating 2D Mesh