Ejemplo n.º 1
0
    def plot_dumbbell_angle(self, image=None, cmap=None,
                            vmin=None, vmax=None):
        """Plot the dumbbell angles as points on an image.

        Parameters
        ----------
        image : NumPy 2D array, optional
        cmap : string
            Matplotlib colormap name, default 'viridis'
        vmin, vmax : scalars
            Min and max values for the scatter points

        Returns
        -------
        fig : matplotlib figure

        Examples
        --------
        >>> dl = am.dummy_data.get_dumbbell_heterostructure_dumbbell_lattice()
        >>> fig = dl.plot_dumbbell_angle()

        """
        if image is None:
            if self.original_image is None:
                image = self.image
            else:
                image = self.original_image
        x, y = self.dumbbell_x, self.dumbbell_y
        z = self.dumbbell_angle
        fig = pl._make_figure_scatter_point_on_image(
                image, x, y, z, cmap=cmap, vmin=vmin, vmax=vmax)
        return fig
Ejemplo n.º 2
0
    def plot_dumbbell_intensity_difference(
            self, radius=4, image=None, cmap=None, vmin=None, vmax=None):
        """Plot the dumbbell intensity difference as points on an image.

        Parameters
        ----------
        radius : int
            Default 4
        image : NumPy 2D array, optional
        cmap : string
            Matplotlib colormap name, default 'viridis'
        vmin, vmax : scalars
            Min and max values for the scatter points

        Returns
        -------
        fig : matplotlib figure

        Examples
        --------
        >>> dl = am.dummy_data.get_dumbbell_heterostructure_dumbbell_lattice()
        >>> fig = dl.plot_dumbbell_intensity_difference()

        See also
        --------
        get_dumbbell_intensity_difference : for getting the data itself

        """
        if image is None:
            if self.original_image is None:
                image = self.image
            else:
                image = self.original_image
        x, y = self.dumbbell_x, self.dumbbell_y
        z = self.get_dumbbell_intensity_difference(radius=radius, image=image)
        fig = pl._make_figure_scatter_point_on_image(
                image, x, y, z, cmap=cmap, vmin=vmin, vmax=vmax)
        return fig
Ejemplo n.º 3
0
 def test_vmin_vmax(self):
     image = np.random.random((100, 100))
     x, y = np.arange(50), np.arange(50)
     z = np.random.randint(1, 9, size=50)
     pl._make_figure_scatter_point_on_image(
             image, x, y, z, vmin=-10, vmax=-2)
Ejemplo n.º 4
0
 def test_cmap(self):
     image = np.random.random((100, 100))
     x, y = np.arange(50), np.arange(50)
     z = np.random.randint(1, 9, size=50)
     pl._make_figure_scatter_point_on_image(
             image, x, y, z, cmap='inferno')
Ejemplo n.º 5
0
 def test_simple(self):
     image = np.random.random((100, 100))
     x, y = np.arange(50), np.arange(50)
     z = np.random.randint(1, 9, size=50)
     fig = pl._make_figure_scatter_point_on_image(image, x, y, z)
     fig.show()