.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "glr_examples/methods/plot_phase_tensors.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_glr_examples_methods_plot_phase_tensors.py: =================================== Plot Pseudosection Phase tensors =================================== Give an ellipse representation of phase tensors in pseudo-section format. .. GENERATED FROM PYTHON SOURCE LINES 9-12 .. code-block:: Python # Author: L.Kouadio # Licence: BSD-3-clause .. GENERATED FROM PYTHON SOURCE LINES 13-19 Plot the phase tensors with different parameters for ellipses such as ``[ 'phimin' | 'phimax' | 'skew' |'skew_seg' | 'phidet' |'ellipticity' ]`` For demonstration, we will use the data collected from Huayuan (:func:`watex.datasets.load_huayuan`) area with 27 samples. Here, we will give three representations of phase tensors ellipsis. Import required modules as: .. GENERATED FROM PYTHON SOURCE LINES 19-27 .. code-block:: Python import watex as wx from watex.view import TPlot # fetch the Huayuan data edi_samples = wx.fetch_data ('huayuan', samples =27 , return_data = True ) # can also be # >>> from watex.datasets import load_huayuan # >>> edi_samples = load_huayuan ( samples =27, return_data =True ) .. GENERATED FROM PYTHON SOURCE LINES 28-29 * Ellipse of ``'phimin'`` .. GENERATED FROM PYTHON SOURCE LINES 29-44 .. code-block:: Python tplot= TPlot (fig_size =( 5, 2 )).fit(edi_samples ) # ------------------------------------------------------------------------------------- # TO BUILD THE DOC WITH MATPLOTLIB >3.5.3, COMMENT # THE LINES STARTING WITH "tplot." SEE RELEASE NOTES v0.1.6 FOR THE REASON # ------------------------------------------------------------------------------------- # # We can skip the ellip_dic config by using the default customization # from the Matplotlib conventional colormap instead. ellip_dic = {'ellipse_colorby':'phimin', 'ellipse_range':[0 , 90], # Color limits for skew 'ellip_size': 2, 'ellipse_cmap': 'mt_bl2wh2rd'# or color 'bwr' defined in `cmap` parameter } tplot.plot_phase_tensors (ellipse_dict= ellip_dic) # by default the color limit for 'phmin' is [0, 90] .. image-sg:: /glr_examples/methods/images/sphx_glr_plot_phase_tensors_001.png :alt: $\Phi$ = 1 :srcset: /glr_examples/methods/images/sphx_glr_plot_phase_tensors_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Reading 27 stations ------------------------- phimin min = -65.62 phimin max = 72.32 ------------------------- <'TPlot':survey_area=None, distance=50.0, prefix='S', window_size=5, component='xy', mode='same', method='slinear', out='srho', how='py', c=2> .. GENERATED FROM PYTHON SOURCE LINES 45-48 * Ellipse of ``'skew'`` visualization we can setup the ellipses dictionary and passed to the parameter `ellipse_dict`: .. GENERATED FROM PYTHON SOURCE LINES 48-57 .. code-block:: Python ellip_dic_sk = {'ellipse_colorby':'skew', 'ellipse_range':[-1 , 1], # Color limits for skew 'ellip_size': 2, 'ellipse_cmap':'PuOr' # or color defined in `cmap` parameter such as `mt_bl2wh2rd` } # tplot.plot_phase_tensor (ellipse_dict=ellip_dic_sk ) # or simply turn on `tensor` parameter to ``skew`` like: tplot.plot_phase_tensors (tensor='skew') .. image-sg:: /glr_examples/methods/images/sphx_glr_plot_phase_tensors_002.png :alt: $\Phi$ = 1 :srcset: /glr_examples/methods/images/sphx_glr_plot_phase_tensors_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Reading 27 stations ------------------------- skew min = -88.72 skew max = 86.05 ------------------------- <'TPlot':survey_area=None, distance=50.0, prefix='S', window_size=5, component='xy', mode='same', method='slinear', out='srho', how='py', c=2> .. GENERATED FROM PYTHON SOURCE LINES 58-59 * Determinant of phase tensor ``'phidet'`` .. GENERATED FROM PYTHON SOURCE LINES 59-61 .. code-block:: Python tplot.plot_phase_tensors (tensor='phidet') .. image-sg:: /glr_examples/methods/images/sphx_glr_plot_phase_tensors_003.png :alt: $\Phi$ = 1 :srcset: /glr_examples/methods/images/sphx_glr_plot_phase_tensors_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Reading 27 stations ------------------------- phidet min = 3.39 phidet max = 737.21 ------------------------- <'TPlot':survey_area=None, distance=50.0, prefix='S', window_size=5, component='xy', mode='same', method='slinear', out='srho', how='py', c=2> .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 12.450 seconds) .. _sphx_glr_download_glr_examples_methods_plot_phase_tensors.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/watex/watex/0.3.X?urlpath=lab/tree/notebooks/glr_examples/methods/plot_phase_tensors.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_phase_tensors.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_phase_tensors.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_