コード例 #1
0
def test_dynamic_lisa_rose():
    _, y1, rose = _data_generation()
    fig1, _ = dynamic_lisa_rose(rose)
    plt.close(fig1)

    fig2, _ = dynamic_lisa_rose(rose, attribute=y1)
    plt.close(fig2)
    
    fig3, _ = dynamic_lisa_rose(rose, c='r')
    plt.close(fig3)
コード例 #2
0
def test_dynamic_lisa_rose():
    from splot.giddy import dynamic_lisa_rose

    _, y1, rose = _data_generation()
    fig1, _ = dynamic_lisa_rose(rose)
    plt.close(fig1)

    fig2, _ = dynamic_lisa_rose(rose, attribute=y1)
    plt.close(fig2)

    fig3, _ = dynamic_lisa_rose(rose, c="r")
    plt.close(fig3)

    raises(ValueError, dynamic_lisa_rose, rose, attribute=y1, color="blue")
コード例 #3
0
    def plot(self, attribute=None, ax=None, **kwargs):
        """
        Plot the rose diagram.

        Parameters
        ----------
        attribute : (n,) ndarray, optional
            Variable to specify colors of the colorbars.
        ax : Matplotlib Axes instance, optional
            If given, the figure will be created inside this axis.
            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
コード例 #4
0
def test_dynamic_lisa_rose():
    _, y1, rose = _data_generation()
    fig1, _ = dynamic_lisa_rose(rose)
    plt.close(fig1)

    fig2, _ = dynamic_lisa_rose(rose, attribute=y1)
    plt.close(fig2)

    fig3, _ = dynamic_lisa_rose(rose, c='r')
    plt.close(fig3)

    assert_raises(ValueError,
                  dynamic_lisa_rose,
                  rose,
                  attribute=y1,
                  color='blue')