예제 #1
0
    def plot(self, f, fc, ss):
        ax = utilmpl.plot_template(f, fc, xlabel=self.xlabel, title=self.title,
                                scale_bar=False, bump=1.2)

        utilvtk.vtk2imshow(self.renWin, ax[0], ss)
        ax[0].axis('off')
        ax[1].axis('off')
예제 #2
0
    def plot(self, f, fc):
        ax = utilmpl.plot_template(f,
                                   fc,
                                   xlabel=self.xlabel,
                                   title=self.title,
                                   scale_bar=False)

        # Plot to axis
        utilvtk.vtk2imshow(self.renWin, ax[0])

        # Turn off axis outline
        ax[0].axis('off')

        # Colorbar
        vmin = -1
        vmax = 1
        x = np.linspace(vmin, vmax, 100)
        xx, yy = np.meshgrid(x, x)

        ax[1].imshow(yy,
                     vmin=vmin,
                     vmax=vmax,
                     cmap='bwr',
                     extent=[0, 1, vmin, vmax],
                     aspect='auto',
                     interpolation='bicubic',
                     origin='lower')
        ax[1].annotate('${:.2g}$'.format(np.max(vmax)),
                       xy=(0, 0),
                       xytext=(1.8, 1.0),
                       textcoords='axes fraction',
                       va='center',
                       ha='left')
        ax[1].annotate('$-{:.2g}$'.format(np.max(vmax)),
                       xy=(0, 0),
                       xytext=(1.8, 0),
                       textcoords='axes fraction',
                       va='center',
                       ha='left')
        ax[1].yaxis.set_ticks([vmin, vmax])
        ax[1].set_yticklabels(['', ''])