How to use the splot.giddy function in splot

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 / 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 3 months ago

Package Health Score

70 / 100
Full package analysis