def test_03(self): x = np.linspace(-1, 1, 20)[np.newaxis, :] y = np.linspace(-1, 1, 20)[:, np.newaxis] z = np.sqrt(x**2 + y**2) fig = plot.figure() plot.surf(z, title='Surf Test', xlbl='x', ylbl='y', zlbl='z') plot.close()
def test_03(self): fig, ax = plot.subplots(nrows=1, ncols=1) plot.surf(self.z, title='Surf Test', xlbl='x', ylbl='y', zlbl='z', elev=0.0, fgrf=fig, axrf=ax) plot.close()
def test_04(self): fig = plot.figure() plot.surf(self.z, x=self.x, y=self.y, title='Surf Test', xlbl='x', ylbl='y', zlbl='z', fgrf=fig) plot.close()
def test_02(self): x = np.linspace(-1, 1, 20)[np.newaxis, :] y = np.linspace(-1, 1, 20)[:, np.newaxis] z = np.sqrt(x**2 + y**2) fig = plot.figure() plot.surf(z, x=x, y=y, title='Surf Test', xlbl='x', ylbl='y', zlbl='z', fgrf=fig)
fig1 = plot.figure(1, figsize=(6,8)) plot.subplot(1,2,1) plot.imview(x0, fgrf=fig1, cmap=plot.cm.Blues, title='Reference') plot.subplot(1,2,2) plot.imview(b.Y, fgrf=fig1, cmap=plot.cm.Blues, title='Reconstruction') fig1.show() # Plot lmbda,mu error surface, functional value, residuals, and rho its = b.getitstat() fig2 = plot.figure(2, figsize=(14,14)) ax = fig2.add_subplot(2, 2, 1, projection='3d') ax.xaxis._axinfo['label']['space_factor'] = 1.8 ax.yaxis._axinfo['label']['space_factor'] = 1.8 ax.zaxis._axinfo['label']['space_factor'] = 1.8 plot.surf(fvmx, x=np.log10(mrng), y=np.log10(lrng), xlbl='log($\mu$)', ylbl='log($\lambda$)', zlbl='Error', fgrf=fig2, axrf=ax) plot.subplot(2,2,2) plot.plot(its.ObjFun, fgrf=fig2, ptyp='semilogy', xlbl='Iterations', ylbl='Functional') plot.subplot(2,2,3) plot.plot(np.vstack((its.PrimalRsdl, its.DualRsdl)).T, fgrf=fig2, ptyp='semilogy', xlbl='Iterations', ylbl='Residual', lgnd=['Primal', 'Dual']); plot.subplot(2,2,4) plot.plot(its.Rho, fgrf=fig2, xlbl='Iterations', ylbl='Penalty Parameter') fig2.show() # Wait for enter on keyboard input()
def surf(*args, **kwargs): warnings.warn( "sporco.util.surf is deprecated: please use sporco.plot.surf") return spl.surf(*args, **kwargs)
Define `x` and `y` arrays and a 2-d surface on `x`, `y`. """ x = np.linspace(0, 2, 50)[np.newaxis, :] y = np.linspace(-1, 1, 51)[:, np.newaxis] z = np.sin(y) * np.cos(2 * x * y) """ Plot a surface plot of the surface, including contour lines at the bottom of the `z` axis. """ plot.surf(z, x, y, elev=25, azim=-25, xlbl='x', ylbl='y', zlbl='z', title='Surface Plot Example', cntr=5, fgsz=(7, 6)) """ Plot a contour plot of the same surface. """ plot.contour(z, x, y, xlbl='x', ylbl='y', title='Contour Plot Example',
""" Define `x` and `y` arrays and a 2-d surface on `x`, `y`. """ x = np.linspace(0, 2, 50)[np.newaxis, :] y = np.linspace(-1, 1, 51)[:, np.newaxis] z = np.sin(y) * np.cos(2*x*y) """ Plot a surface plot of the surface, including contour lines at the bottom of the `z` axis. """ plot.surf(z, x, y, elev=25, azim=-25, xlbl='x', ylbl='y', zlbl='z', title='Surface Plot Example', cntr=5, fgsz=(7, 6)) """ Plot a contour plot of the same surface. """ plot.contour(z, x, y, xlbl='x', ylbl='y', title='Contour Plot Example', fgsz=(6, 5)) """ We can also plot within subplots of the same figure. """ fig, ax = plot.subplots(nrows=1, ncols=2, figsize=(12.1, 5))
def surf(*args, **kwargs): warnings.warn("sporco.util.surf is deprecated: use sporco.plot.surf", PendingDeprecationWarning) return spl.surf(*args, **kwargs)
def test_03(self): fig = plot.figure() plot.surf(self.z, title='Surf Test', xlbl='x', ylbl='y', zlbl='z') plot.close()
plot.subplot(1, 2, 1) plot.imview(x0, cmap=plot.cm.Blues, title='Reference', fig=fig) plot.subplot(1, 2, 2) plot.imview(x, cmap=plot.cm.Blues, title='Reconstruction', fig=fig) fig.show() """ Plot lmbda,mu error surface, functional value, residuals, and rho """ its = b.getitstat() fig = plot.figure(figsize=(15, 10)) ax = fig.add_subplot(2, 2, 1, projection='3d') ax.locator_params(nbins=5, axis='y') plot.surf(fvmx, x=np.log10(mrng), y=np.log10(lrng), xlbl='log($\mu$)', ylbl='log($\lambda$)', zlbl='Error', fig=fig, ax=ax) plot.subplot(2, 2, 2) plot.plot(its.ObjFun, xlbl='Iterations', ylbl='Functional', fig=fig) plot.subplot(2, 2, 3) plot.plot(np.vstack((its.PrimalRsdl, its.DualRsdl)).T, ptyp='semilogy', xlbl='Iterations', ylbl='Residual', lgnd=['Primal', 'Dual'], fig=fig) plot.subplot(2, 2, 4) plot.plot(its.Rho, xlbl='Iterations', ylbl='Penalty Parameter', fig=fig) fig.show() # Wait for enter on keyboard input()