watex.view.plot2d#

watex.view.plot2d(ar, y=None, x=None, distance=50.0, stnlist=None, prefix='S', how='py', to_log10=False, plot_contours=False, top_label='', **baseplot_kws)[source]#

Two dimensional template for visualization matrices.

It is a wrappers that can plot any matrice by customizing the position X and y. By default X is considering as stations and y the resistivity log data.

Parameters
  • ar (Array-like 2D, shape (M, N)) – 2D array for plotting. For instance, it can be a 2D resistivity collected at all stations (N) and all frequency (M)

  • y (array-like, default=None) – Y-coordinates. It should have the length N, the same of the arr2d. the rows of the arr2d.

  • x (array-like, default=None,) – X-coordinates. It should have the length M, the same of the arr2d; the columns of the 2D dimensional array. Note that if x is given, the `distance is not needed.

  • distance (float) – The step between two stations. If given, it creates an array of position for plotting purpose. Default value is 50 meters.

  • stnlist (list of str) – List of stations names. If given, it should have the same length of the columns M, of arr2d`

  • prefix (str) – string value to add as prefix of given id. Prefix can be the site name. Default is S.

  • how (str) – Mode to index the station. Default is ‘Python indexing’ i.e. the counting of stations would starts by 0. Any other mode will start the counting by 1.

  • to_log10 (bool, default=False) – Recompute the ar in logarithm base 10 values. Note when True, the y should be also in log10.

  • plot_contours (bool, default=True) – Plot the contours map. Is available only if the plot_style is set to pcolormesh.

  • baseplot_kws (dict,) – All all the keywords arguments passed to the property watex.property.BasePlot class.

Returns

axe

Return type

<AxesSubplot> object

Examples

>>> import numpy as np
>>> import watex
>>> np.random.seed (42)
>>> data = np.random.randn ( 15, 20 )
>>> data_nan = data.copy()
>>> data_nan [2, 1] = np.nan; data_nan[4, 2]= np.nan;  data_nan[6, 3]=np.nan
>>> watex.view.mlplot.plot2d (data )
<AxesSubplot:xlabel='Distance(m)', ylabel='log10(Frequency)[Hz]'>
>>> watex.view.mlplot.plot2d (data_nan ,  plt_style = 'imshow',
                              fig_size = (10, 4))