Plotting Utilities

class multineas.plot.CornerPlot(properties, figsize=3, fontsize=10, direction='out')[source]

Bases: object

Create a grid of plots showing the projection of a N-dimensional data.

Parameters:
  • properties (dict) –

    List of properties to be shown, dictionary of dictionaries (N entries). Keys are label of attribute, ex. “q”. Dictionary values:

    • label: label used in axis, string

    • range: range for property, tuple (2)

  • figsize (int, optional) – Base size for panels (the size of figure will be M x figsize), default 3.

  • fontsize (int, optional) – Base fontsize, default 10.

  • direction (str, optional) – Direction of ticks in panels, default ‘out’.

N

Number of properties.

Type:

int

M

Size of grid matrix (M=N-1).

Type:

int

fw

Figsize.

Type:

int

fs

Fontsize.

Type:

int

fig

Figure handle.

Type:

matplotlib.figure.Figure

axs

Matrix with subplots, axes handles (MxM).

Type:

numpy.ndarray

axp

Matrix with subplots, dictionary of dictionaries.

Type:

dict

properties

List of properties labels, list of strings (N).

Type:

list

tight_layout()[source]

Tight layout if no constrained_layout was used.

set_labels(**args)[source]

Set labels parameters.

set_ranges()[source]

Set ranges in panels according to ranges defined in dparameters.

set_tick_params(**args)[source]

Set tick parameters.

plot_hist(data, colorbar=False, \*\*args)[source]

Create a 2d-histograms of data on all panels of the CornerPlot.

scatter_plot(data, \*\*args)[source]

Scatter plot on all panels of the CornerPlot.

plot_hist(data, colorbar=False, **args)[source]

Create a 2d-histograms of data on all panels of the CornerPlot.

Parameters:
  • data (numpy.ndarray) – Data to be histogramed (n=len(data)), numpy array (nxN).

  • colorbar (bool, optional) – Include a colorbar? (default False).

  • **args (dict) – All arguments of hist2d method.

Returns:

hist – List of histogram instances.

Return type:

list

Examples

>>> properties = {
...     'Q': {'label': r"$Q$", 'range': None},
...     'E': {'label': r"$C$", 'range': None},
...     'I': {'label': r"$I$", 'range': None},
... }
>>> G = mm.CornerPlot(properties, figsize=3)
>>> hargs = dict(bins=100, cmap='viridis')
>>> hist = G.plot_hist(udata, **hargs)

Attr. [HC]

scatter_plot(data, **args)[source]

Scatter plot on all panels of the CornerPlot.

Parameters:
  • data (numpy.ndarray) – Data to be histogramed (n=len(data)), numpy array (nxN).

  • **args (dict) – All arguments of scatter method.

Returns:

scatter – List of scatter instances.

Return type:

list

Examples

>>> sargs = dict(s=0.2, edgecolor='None', color='r')
>>> hist = G.scatter_plot(udata, **sargs)

Attr. [HC]

set_labels(**args)[source]

Set labels parameters.

Parameters:
  • **args (dict) – Common arguments of set_xlabel, set_ylabel and text.

  • [HC] (Attr.)

set_ranges()[source]

Set ranges in panels according to ranges defined in dparameters.

Attr. [HC]

set_tick_params(**args)[source]

Set tick parameters.

Parameters:
  • **args (dict) – Same arguments as tick_params method.

  • [HC] (Attr.)

tight_layout()[source]

Tight layout if no constrained_layout was used.

Attr. [HC]

multineas.plot.multineas_watermark(ax, enlarge=1, alpha=0.5)[source]

Add a water mark to a 2d or 3d plot.

Parameters:

ax: Class axes:

Axe where the pryngles mark will be placed.