Skip to content

Compatibility with matplotlib 3.10 #96

Open
@xumi1993

Description

@xumi1993
def ci(allstack, h, kappa, ev_num):
        """
        Search best H and kappa from stacked matrix.
        Calculate error for H and kappa
    
        :param allstack: stacked HK matrix
        :param h: 1-D array of H
        :param kappa: 1-D array of kappa
        :param ev_num: event number
        :return:
        """
        [i, j] = np.unravel_index(allstack.argmax(), allstack.shape)
        bestk = kappa[i]
        besth = h[j]
    
        cvalue = 1 - np.std(allstack.reshape(allstack.size)) / np.sqrt(ev_num)
        cs = plt.contour(h, kappa, allstack, [cvalue])
>       cs_path = cs.collections[0].get_paths()[0].vertices
E       AttributeError: 'QuadContourSet' object has no attribute 'collections'

This error will be raised when using matplotlib 3.10. using

 cs_path = cs.get_paths()[0].vertices

instead in the future version.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions