Example #1
0
    def test_plot_cuboid2d_as_image(self):
        from pyhrf.ndarray import xndarray
        import matplotlib

        sh = (10, 3)
        c1 = xndarray(
            np.arange(np.prod(sh)).reshape(sh),
            axes_names=["sagittal", "condition"],
            axes_domains={"condition": ["audio1", "audio2", "video"]},
        )

        f = plt.figure()
        ax = f.add_subplot(111)

        ori = ["condition", "sagittal"]
        cm = matplotlib.cm.get_cmap("winter")
        norm = matplotlib.colors.Normalize(vmin=5, vmax=20)
        plot_cub_as_image(
            c1.reorient(ori),
            cmap=cm,
            norm=norm,
            axes=ax,
            show_axes=True,
            show_axis_labels=True,
            show_colorbar=True,
            show_tick_labels=False,
        )
        if 0:
            plt.show()
Example #2
0
    def test_plot_cuboid1d_as_image(self):
        from pyhrf.ndarray import xndarray
        import matplotlib
        sh = (3,)
        c2 = xndarray(np.arange(np.prod(sh)).reshape(sh),
                      axes_names=['condition'],
                      axes_domains={'condition': ['audio1', 'audio2', 'video']})

        f = plt.figure()
        ax = f.add_subplot(111)

        cm = matplotlib.cm.get_cmap('winter')
        norm = matplotlib.colors.Normalize(vmin=0., vmax=3.)
        plot_cub_as_image(c2, cmap=cm, norm=norm, axes=ax,
                          show_axes=True, show_axis_labels=True,
                          show_tick_labels=True)
Example #3
0
    def test_plot_cuboid2d_as_image(self):
        from pyhrf.ndarray import xndarray
        import matplotlib
        sh = (10, 3)
        c1 = xndarray(np.arange(np.prod(sh)).reshape(sh),
                      axes_names=['sagittal', 'condition'],
                      axes_domains={'condition': ['audio1', 'audio2', 'video']})

        f = plt.figure()
        ax = f.add_subplot(111)

        ori = ['condition', 'sagittal']
        cm = matplotlib.cm.get_cmap('winter')
        norm = matplotlib.colors.Normalize(vmin=5, vmax=20)
        plot_cub_as_image(c1.reorient(ori), cmap=cm, norm=norm, axes=ax,
                          show_axes=True, show_axis_labels=True,
                          show_colorbar=True,
                          show_tick_labels=False)
Example #4
0
    def test_plot_cuboid1d_as_image(self):
        from pyhrf.ndarray import xndarray
        import matplotlib

        sh = (3,)
        c2 = xndarray(
            np.arange(np.prod(sh)).reshape(sh),
            axes_names=["condition"],
            axes_domains={"condition": ["audio1", "audio2", "video"]},
        )

        f = plt.figure()
        ax = f.add_subplot(111)

        cm = matplotlib.cm.get_cmap("winter")
        norm = matplotlib.colors.Normalize(vmin=0.0, vmax=3.0)
        plot_cub_as_image(c2, cmap=cm, norm=norm, axes=ax, show_axes=True, show_axis_labels=True, show_tick_labels=True)
        if 0:
            plt.show()