How to use splot - 4 common examples

To help you get started, we’ve selected a few splot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pysal / pysal / pysalnext / dynamics / giddy / directional.py View on Github external
>>> plt.show()
        customize plot
        >>> fig, _ = rose.plot()(attribute=y1)
        >>> plt.show()
        """
        use_splot = False
        try:
            import splot.giddy
            use_splot = True
        except ImportError:
            warnings.warn('This method relies on importing `splot` in future',
                          DeprecationWarning)
            use_splot = False

        if use_splot:
            fig, ax = splot.giddy.dynamic_lisa_rose(self, attribute=attribute,
                                                    ax=ax, **kwargs)
        else:
            # This can be removed if splot has been released with support for
            # giddy.directional TODO add **kwargs
            import matplotlib.cm as cm
            import matplotlib.pyplot as plt
            ax = plt.subplot(111, projection='polar')
            ax.set_rlabel_position(315)
            if attribute is None:
                c = ax.scatter(self.theta, self.r)
            else:
                c = ax.scatter(self.theta, self.r, c=attribute)
                plt.colorbar(c)
            fig = ax.get_figure()
        return fig, ax
github pysal / pysal / pysal / explore / giddy / directional.py View on Github external
Default =None. Note, this axis should have a polar projection.
        **kwargs : keyword arguments, optional
            Keywords used for creating and designing the plot.
            Note: 'c' and 'color' cannot be passed when attribute is not None

        Returns
        -------
        fig : Matplotlib Figure instance
            Moran scatterplot figure
        ax : matplotlib Axes instance
            Axes in which the figure is plotted

        """

        from splot.giddy import dynamic_lisa_rose
        fig, ax = dynamic_lisa_rose(self, attribute=attribute,
                                    ax=ax, **kwargs)
        return fig, ax
github pysal / pysal / pysal / explore / giddy / directional.py View on Github external
**kwargs : keyword arguments, optional
            Keywords used for creating and designing the plot.
            Note: 'c' and 'color' cannot be passed when attribute is not None

        Returns
        -------
        fig : Matplotlib Figure instance
            Moran scatterplot figure
        ax : matplotlib Axes instance
            Axes in which the figure is plotted

        """

        from splot.giddy import dynamic_lisa_vectors

        fig, ax = dynamic_lisa_vectors(self, arrows=arrows)
        return fig, ax
github pysal / pysal / pysalnext / dynamics / giddy / directional.py View on Github external
>>> plt.show()
        customize plot
        >>> fig, _ = rose.plot_vectors(arrows=False)
        >>> plt.show()
        """
        use_splot = False
        try:
            import splot.giddy
            use_splot = True
        except ImportError:
            warnings.warn('This method relies on importing `splot` in future',
                          DeprecationWarning)
            use_splot = False
        
        if use_splot:
            fig, ax = splot.giddy.dynamic_lisa_vectors(self, arrows=arrows)
        else:
            # This can be removed if splot has been released with support for
            # giddy.directional TODO add **kwargs, arrow=True
            import matplotlib.cm as cm
            import matplotlib.pyplot as plt
            ax = plt.subplot(111 )
            xlim = [self.Y.min(), self.Y.max()]
            ylim = [self.wY.min(), self.wY.max()]
            for i in range(len(self.Y)):
                xs = self.Y[i,:]
                ys = self.wY[i,:]
                ax.plot(xs,ys, '-b')  # TODO change this to scale with attribute
            plt.axis('equal')
            plt.xlim(xlim)
            plt.ylim(ylim)
            fig = ax.get_figure()

splot

Visual analytics for spatial analysis with PySAL.

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis