Skip to content
Snippets Groups Projects
Commit 13a069bc authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Rename to gridcorner

parent 401a0268
Branches
Tags v0.1
No related merge requests found
...@@ -12,7 +12,7 @@ Generating some fake data and plotting: ...@@ -12,7 +12,7 @@ Generating some fake data and plotting:
```python ```python
import numpy as np import numpy as np
import projection_matrix.projection_matrix as pmp import gridcorner
# Generate example data # Generate example data
x = np.linspace(0, 1, 50) x = np.linspace(0, 1, 50)
...@@ -27,8 +27,8 @@ D = (np.exp(-(X-x0)**2/sigmax**2) ...@@ -27,8 +27,8 @@ D = (np.exp(-(X-x0)**2/sigmax**2)
+ np.exp(-(Y-y0)**2/sigmay**2) + np.exp(-(Y-y0)**2/sigmay**2)
+ np.exp(-(Z-z0)**2/sigmaz**2)) + np.exp(-(Z-z0)**2/sigmaz**2))
fig, axes = pmp( fig, axes = gridcorner.gridcorner(
D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], projection=np.max) D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], projection='log_mean')
fig.savefig('example') fig.savefig('example')
``` ```
![Example plot](example.png) ![Example plot](example.png)
......
example.png

70.7 KiB | W: | H:

example.png

66.8 KiB | W: | H:

example.png
example.png
example.png
example.png
  • 2-up
  • Swipe
  • Onion skin
import numpy as np import numpy as np
import projection_matrix as pmp import gridcorner
# Generate example data # Generate example data
x = np.linspace(0, 1, 50) x = np.linspace(0, 1, 50)
...@@ -15,10 +15,7 @@ D = (np.exp(-(X-x0)**2/sigmax**2) ...@@ -15,10 +15,7 @@ D = (np.exp(-(X-x0)**2/sigmax**2)
+ np.exp(-(Y-y0)**2/sigmay**2) + np.exp(-(Y-y0)**2/sigmay**2)
+ np.exp(-(Z-z0)**2/sigmaz**2)) + np.exp(-(Z-z0)**2/sigmaz**2))
fig, axes = pmp.projection_matrix( fig, axes = gridcorner.gridcorner(
D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], projection='log_mean')
projection=pmp.slice_max,
#projection=np.max
)
fig.savefig('example') fig.savefig('example')
...@@ -47,9 +47,9 @@ def idx_array_slice(D, axis, slice_idx): ...@@ -47,9 +47,9 @@ def idx_array_slice(D, axis, slice_idx):
return res return res
def projection_matrix(D, xyz, labels=None, projection='max_slice', def gridcorner(D, xyz, labels=None, projection='max_slice', max_n_ticks=4,
max_n_ticks=4, factor=3, whspace=0.05, **kwargs): factor=3, whspace=0.05, **kwargs):
""" Generate a projection matrix plot """ Generate a grid corner plot
Parameters Parameters
---------- ----------
...@@ -66,7 +66,7 @@ def projection_matrix(D, xyz, labels=None, projection='max_slice', ...@@ -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 If a string, one of `{"log_mean", "max_slice"} to use inbuilt functions
to calculate either the logged mean or maximum slice projection. Else to calculate either the logged mean or maximum slice projection. Else
a function to use for projection, must take an `axis` argument. Default 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. maximum.
max_n_ticks: int max_n_ticks: int
Number of ticks for x and y axis of the `pcolormesh` plots Number of ticks for x and y axis of the `pcolormesh` plots
......
from .projection_matrix import projection_matrix
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
from distutils.core import setup from distutils.core import setup
setup(name='projection_matrix', setup(name='gridcorner',
version='0.1', version='0.1',
author='Gregory Ashton', author='Gregory Ashton',
author_email='gregory.ashton@ligo.org', author_email='gregory.ashton@ligo.org',
packages=['projection_matrix'], py_modules=['gridcorner'],
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment