### Install mpltern using pip Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/installation.rst Install the latest released version of mpltern from PyPI using pip. ```console python -m pip install -U mpltern ``` -------------------------------- ### Install mpltern from GitHub (Development Version) Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/installation.rst Install the development version of mpltern directly from its GitHub repository using pip. ```console python -m pip install -U git+https://github.com/yuzie007/mpltern.git ``` -------------------------------- ### Install mpltern using Conda Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/installation.rst Install the latest released version of mpltern from conda-forge using Conda. Ensure the conda-forge channel is added. ```console conda config --add channels conda-forge conda install mpltern ``` -------------------------------- ### Create Ternary Axes with Custom Sum and Labels Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/basic_usage.rst Shows how to create a ternary axes with a custom normalization constant (ternary_sum=100.0) and set custom labels for the top, left, and right axes. Includes adding a grid. ```python ax = plt.subplot(projection="ternary", ternary_sum=100.0) ax.set_tlabel("Top (%)") ax.set_llabel("Left (%)") ax.set_rlabel("Right (%)") ax.grid() plt.show() ``` -------------------------------- ### Create a Basic Ternary Axes Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/basic_usage.rst Demonstrates how to create a basic ternary axes object using Matplotlib's subplot functionality with the 'ternary' projection. ```python ax = plt.subplot(projection="ternary") ``` -------------------------------- ### Import mpltern and Matplotlib Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/basic_usage.rst Import mpltern along with Matplotlib for use in ternary plots. This registers the 'ternary' projection. ```python import matplotlib.pyplot as plt import mpltern ``` -------------------------------- ### mpltern.ternary.TernaryAxes.axlspan Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Creates a span on the left axis. ```APIDOC ## mpltern.ternary.TernaryAxes.axlspan ### Description Creates a span on the left axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.hexbin Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Creates a hexagonal binning plot. ```APIDOC ## mpltern.ternary.TernaryAxes.hexbin ### Description Creates a hexagonal binning plot. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.axtspan Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Creates a span on the top axis. ```APIDOC ## mpltern.ternary.TernaryAxes.axtspan ### Description Creates a span on the top axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.axlline Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Draws a line on the left axis. ```APIDOC ## mpltern.ternary.TernaryAxes.axlline ### Description Draws a line on the left axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.axtline Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Draws a line on the top axis. ```APIDOC ## mpltern.ternary.TernaryAxes.axtline ### Description Draws a line on the top axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.tribin Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Creates a triangular binning plot. ```APIDOC ## mpltern.ternary.TernaryAxes.tribin ### Description Creates a triangular binning plot. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.axrspan Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Creates a span on the right axis. ```APIDOC ## mpltern.ternary.TernaryAxes.axrspan ### Description Creates a span on the right axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.axrline Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Draws a line on the right axis. ```APIDOC ## mpltern.ternary.TernaryAxes.axrline ### Description Draws a line on the right axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### Plotting Data on Ternary Axes Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/basic_usage.rst Illustrates how to plot data points on a ternary axes using the `ax.plot` method. Requires three variables (t, l, r) for the top, left, and right axes. ```python from mpltern.datasets import get_spiral ax = plt.subplot(projection="ternary") t, l, r = get_spiral() # t: [0.33333333 0.33357906 0.33430414 ...] # l: [0.33333333 0.33455407 0.33543547 ...] # r: [0.33333333 0.33186687 0.33026039 ...] ax.plot(t, l, r) plt.show() ``` -------------------------------- ### mpltern.ternary.TernaryAxes.set_llabel Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Sets the label for the left axis. ```APIDOC ## mpltern.ternary.TernaryAxes.set_llabel ### Description Sets the label for the left axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.set_tlabel Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Sets the label for the top axis. ```APIDOC ## mpltern.ternary.TernaryAxes.set_tlabel ### Description Sets the label for the top axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### mpltern.ternary.TernaryAxes.set_rlabel Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/api.rst Sets the label for the right axis. ```APIDOC ## mpltern.ternary.TernaryAxes.set_rlabel ### Description Sets the label for the right axis. ### Method N/A (Method of TernaryAxes class) ### Parameters (Parameters not explicitly detailed in the source) ### Response (Response details not explicitly detailed in the source) ``` -------------------------------- ### Filled Contour Plot on Ternary Axes Source: https://github.com/yuzie007/mpltern/blob/master/docsrc/basic_usage.rst Demonstrates creating a filled contour plot on a ternary axes using `ax.tricontourf`. Requires t, l, r coordinates and corresponding data values. ```python from mpltern.datasets import get_shanon_entropies ax = plt.subplot(projection="ternary") t, l, r, entropies = get_shanon_entropies() # t: [ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.1 0.1 0.1 ...] # l: [ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 0. 0.1 0.2 ...] # r: [ 1. 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0. 0.9 0.8 0.7 ...] # v: [-0. 0.32508297 0.50040242 ...] ax.tricontourf(t, l, r, entropies) plt.show() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.