Esempio n. 1
0
import pandas as pd
import matplotlib.pyplot as plt
import pyrolite.plot

# sphinx_gallery_thumbnail_number = 2

np.random.seed(82)
########################################################################################
# First we'll generate some example synthetic data based around Depleted Morb Mantle:
#
from pyrolite.util.synthetic import example_spider_data

df = example_spider_data(
    noise_level=0.05,
    nobs=100,
    start="DMM_WH2005",
    norm_to="Chondrite_PON",
    offsets={"Eu": 0.2},
)
########################################################################################
# Let's have a quick look at what this REE data looks like:
#
df.pyroplot.REE(alpha=0.05, c="k", unity_line=True)
plt.show()
########################################################################################
# From this REE data we can fit a series of orthogonal polynomials, and subsequently used
# the regression coefficients ('lambdas') as a parameterisation of the REE
# pattern/profile. This example data is already normalised to Chondrite, so to avoid
# double-normalising, we pass :code:`norm_to=None`:
#
ls = df.pyrochem.lambda_lnREE(degree=4, norm_to=None)
Esempio n. 2
0
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pyrolite.plot import pyroplot

# sphinx_gallery_thumbnail_number = 3

########################################################################################
# Here we generate some example data, using the
# :func:`~pyrolite.util.synthetic.example_spider_data` function (based on EMORB,
# here normalised to Primitive Mantle);
#
from pyrolite.util.synthetic import example_spider_data

df = example_spider_data(noise_level=0.1, size=20)

########################################################################################
# Where data is specified, the default plot is a line-based spiderplot:
ax = df.pyroplot.REE(color="0.5", figsize=(8, 4))
plt.show()
########################################################################################
# This behaviour can be modified (see spiderplot docs) to provide e.g. filled ranges:
#
df.pyroplot.REE(mode="fill", color="0.5", alpha=0.5, figsize=(8, 4))
plt.show()
########################################################################################
# The plotting axis can be specified to use exisiting axes:
#
fig, ax = plt.subplots(1, 2, sharey=True, figsize=(12, 4))
Esempio n. 3
0
import pandas as pd
import pyrolite.plot

# sphinx_gallery_thumbnail_number = 2

np.random.seed(82)
########################################################################################
# First we'll generate some example synthetic data based around Depleted MORB Mantle:
#
from pyrolite.util.synthetic import example_spider_data

df = example_spider_data(
    noise_level=0.05,
    size=100,
    start="DMM_WH2005",
    norm_to="Chondrite_PON",
    offsets={
        "Eu": 0.2
    },
).pyrochem.REE.pyrochem.denormalize_from("Chondrite_PON")
df.head(2)
########################################################################################
# Let's have a quick look at what this REE data looks like normalized to Primitive
# Mantle:
#
df.pyrochem.normalize_to("PM_PON").pyroplot.REE(alpha=0.05,
                                                c="k",
                                                unity_line=True)
plt.show()
########################################################################################
# From this REE data we can fit a series of orthogonal polynomials, and subsequently used
Esempio n. 4
0
# sphinx_gallery_thumbnail_number = 3

########################################################################################
# Here we'll set up an example which uses EMORB as a starting point. Typically we'll
# normalise trace element compositions to a reference composition
# to be able to link the diagram to 'relative enrichement' occuring during geological
# processes, so here we're normalising to a Primitive Mantle composition first.
# We're here taking this normalised composition and adding some noise in log-space to
# generate multiple compositions about this mean (i.e. a compositional distribution).
# For simplicility, this is handlded by
# :func:`~pyrolite.util.synthetic.example_spider_data`:
#
from pyrolite.util.synthetic import example_spider_data

normdf = example_spider_data(start="EMORB_SM89", norm_to="PM_PON")

########################################################################################
# .. seealso:: `Normalisation <../geochem/normalization.html>`__
#

########################################################################################
# Basic spider plots are straightforward to produce:
#
import pyrolite.plot

ax = normdf.pyroplot.spider(color="0.5",
                            alpha=0.5,
                            unity_line=True,
                            figsize=(10, 4))
ax.set_ylabel("X / $X_{Primitive Mantle}$")