Plots

This module houses the interactive plotting functions.

Histogram

pyLPM.plots.histogram(data, n_bins=20, wt=None, title='', x_axis='', y_axis='', cdf=False, figsize=(700, 700))[source]

Histogram plot

Parameters:
  • data (array) – data values array
  • n_bins (int, optional) – number of bins. Defaults to 20.
  • wt (array, optional) – weights values array. Defaults to None.
  • title (str, optional) – plot title. Defaults to ‘’.
  • x_axis (str, optional) – x axis title. Defaults to ‘’.
  • y_axis (str, optional) – y axis title. Defaults to ‘’.
  • cdf (bool, optional) – cdf flag. Defaults to False.
  • figsize (tuple, optional) – figure size. Defaults to (700,700).
Returns:

histogram plot

Return type:

iplot

Scatterplot

pyLPM.plots.scatter2d(x, y, variable='kernel density', xy_line=True, best_fit_line=True, title='', x_axis='', y_axis='', pointsize=8, colorscale='Viridis', colorbartitle='', figsize=(700, 700))[source]

2D scatter plot

Parameters:
  • x (array) – x variable data array
  • y (array) – y variable data array
  • variable (str, optional) – variable to color points. Defaults to ‘kernel density’.
  • xy_line (bool, optional) – x=y line flag. Defaults to True.
  • best_fit_line (bool, optional) – best fit line flag. Defaults to True.
  • title (str, optional) – plot title. Defaults to ‘’.
  • x_axis (str, optional) – x axis title. Defaults to ‘’.
  • y_axis (str, optional) – y axis title. Defaults to ‘’.
  • pointsize (int, optional) – point size. Defaults to 8.
  • colorscale (str, optional) – color scale. Defaults to ‘Viridis’.
  • colorbartitle (str, optional) – color bar title. Defaults to ‘’.
  • figsize (tuple, optional) – figure size. Defaults to (700,700).
Returns:

2D scatter plot

Return type:

iplot

QQ plot

pyLPM.plots.qqplot(x, y, dicretization=100, title='', x_axis='', y_axis='', pointsize=8, figsize=(700, 700))[source]

QQ plot

Parameters:
  • x (array) – x variable data array
  • y (array) – y variable data array
  • dicretization (int, optional) – number of quantiles to plot. Defaults to 100.
  • title (str, optional) – plot title. Defaults to ‘’.
  • x_axis (str, optional) – x axis title. Defaults to ‘’.
  • y_axis (str, optional) – y axis title. Defaults to ‘’.
  • pointsize (int, optional) – point size. Defaults to 8.
  • figsize (tuple, optional) – figure size. Defaults to (700,700).
Returns:

QQ plot

Return type:

iplot

Locmap

pyLPM.plots.locmap(x, y, variable, categorical=False, title='', x_axis='Easting (m)', y_axis='Northing (m)', pointsize=8, colorscale='Jet', colorbartitle='', figsize=(700, 700))[source]

Plots a location map for samples

Parameters:
  • x (array) – x values array
  • y (array) – y values array
  • variable (array) – variables values array
  • categorical (bool, optional) – Categorical variable flag. Defaults to False.
  • title (str, optional) – Plot title. Defaults to ‘’.
  • x_axis (str, optional) – x axis title. Defaults to ‘Easting (m)’.
  • y_axis (str, optional) – y axis title. Defaults to ‘Northing (m)’.
  • pointsize (int, optional) – point size. Defaults to 8.
  • colorscale (str, optional) – color scale. Defaults to ‘Jet’.
  • colorbartitle (str, optional) – colorbar title. Defaults to ‘’.
  • figsize (tuple, optional) – figure size. Defaults to (700,700).
Returns:

Location map

Return type:

iplot

Pixel plot

pyLPM.plots.pixelplot(grid_dic, variable, categorical=False, points=None, gap=0, title='', x_axis='Easting (m)', y_axis='Northing (m)', colorscale='Jet', colorbartitle='', figsize=(700, 700))[source]

Pixel plot for gridded data

Parameters:
  • grid_dic (dict) – grid definitions dictionary
  • variable (array) – data values array
  • categorical (bool, optional) – categorical data flag. Defaults to False.
  • points (lst, optional) – [x,y,z,var] list to plot points on top of grid. Defaults to None.
  • gap (int, optional) – gap between blocks. Defaults to 0.
  • title (str, optional) – plt title. Defaults to ‘’.
  • x_axis (str, optional) – x axis title. Defaults to ‘Easting (m)’.
  • y_axis (str, optional) – y axis title. Defaults to ‘Northing (m)’.
  • colorscale (str, optional) – color scale. Defaults to ‘Jet’.
  • colorbartitle (str, optional) – color bar title. Defaults to ‘’.
  • figsize (tuple, optional) – figure size. Defaults to (700,700).
Returns:

pixel plot

Return type:

iplot

Swath plots

pyLPM.plots.swath_plots(x, y, z, point_var, grid, grid_var, n_bins=10)[source]

Swath plots in x, y and z

Parameters:
  • x (array) – x coordinates array
  • y (array) – y coordinates array
  • z (array) – z coordinates array
  • point_var (array) – point variable array
  • grid (dict) – grid definitions dictionary
  • grid_var (array) – gridded variable array
  • n_bins (int, optional) – number of bins. Defaults to 10.
Returns:

swath plots

Return type:

iplot