diff --git a/README.md b/README.md index 0a9a31b9658b896735d3cdc98db1c9a417da6442..f87b748fc422d040d56507eaeb6b85f8f73ec98f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Generating some fake data and plotting: ```python import numpy as np -import projection_matrix.projection_matrix as pmp +import gridcorner # Generate example data x = np.linspace(0, 1, 50) @@ -27,8 +27,8 @@ D = (np.exp(-(X-x0)**2/sigmax**2) + np.exp(-(Y-y0)**2/sigmay**2) + np.exp(-(Z-z0)**2/sigmaz**2)) -fig, axes = pmp( - D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], projection=np.max) +fig, axes = gridcorner.gridcorner( + D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], projection='log_mean') fig.savefig('example') ```  diff --git a/example.png b/example.png index 10c29e02f7b25109e601362b2b84585c1469f22f..e81ac729038cf39f43c7597dc53162983b08de29 100644 Binary files a/example.png and b/example.png differ diff --git a/example.py b/example.py index f996dd6a6685dceb0809caba6878b33bc02e6486..d55cce298661b675978186cb8ce2b2dbfb717b32 100644 --- a/example.py +++ b/example.py @@ -1,5 +1,5 @@ import numpy as np -import projection_matrix as pmp +import gridcorner # Generate example data x = np.linspace(0, 1, 50) @@ -15,10 +15,7 @@ D = (np.exp(-(X-x0)**2/sigmax**2) + np.exp(-(Y-y0)**2/sigmay**2) + np.exp(-(Z-z0)**2/sigmaz**2)) -fig, axes = pmp.projection_matrix( - D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], - projection=pmp.slice_max, - #projection=np.max - ) +fig, axes = gridcorner.gridcorner( + D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], projection='log_mean') fig.savefig('example') diff --git a/projection_matrix/projection_matrix.py b/gridcorner.py similarity index 95% rename from projection_matrix/projection_matrix.py rename to gridcorner.py index 12ac694b8ba4a5464f24a7122692f2e0b201b04a..e5fd662d5c3bdb9fd9f9e29e326c73949962e1c4 100644 --- a/projection_matrix/projection_matrix.py +++ b/gridcorner.py @@ -47,9 +47,9 @@ def idx_array_slice(D, axis, slice_idx): return res -def projection_matrix(D, xyz, labels=None, projection='max_slice', - max_n_ticks=4, factor=3, whspace=0.05, **kwargs): - """ Generate a projection matrix plot +def gridcorner(D, xyz, labels=None, projection='max_slice', max_n_ticks=4, + factor=3, whspace=0.05, **kwargs): + """ Generate a grid corner plot Parameters ---------- @@ -66,7 +66,7 @@ def projection_matrix(D, xyz, labels=None, projection='max_slice', If a string, one of `{"log_mean", "max_slice"} to use inbuilt functions to calculate either the logged mean or maximum slice projection. Else a function to use for projection, must take an `axis` argument. Default - is `projection_matrix.max_slice()`, to project out a slice along the + is `gridcorner.max_slice()`, to project out a slice along the maximum. max_n_ticks: int Number of ticks for x and y axis of the `pcolormesh` plots diff --git a/projection_matrix/__init__.py b/projection_matrix/__init__.py deleted file mode 100644 index 3a8b37d876720bec77a2f3ec0c2c40801890ae41..0000000000000000000000000000000000000000 --- a/projection_matrix/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .projection_matrix import projection_matrix diff --git a/setup.py b/setup.py index 6f6dab0b20853f71e46597cac6b4fff791540848..99465406cdc00e277069d4aef799c8b2c88aaa57 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +2,9 @@ from distutils.core import setup -setup(name='projection_matrix', +setup(name='gridcorner', version='0.1', author='Gregory Ashton', author_email='gregory.ashton@ligo.org', - packages=['projection_matrix'], + py_modules=['gridcorner'], )