radage.plotting module¶
- radage.plotting.age_rank_plot(ages, ages_2s, ranks=None, ax=None, wid=0.6, patch_dict=None)[source]¶
Rank-age plotting
- Parameters:
ages (array-like) – age means
ages_2s (array-like) – (symmetric) age uncertainty to plot, 2-sigma. Same length as ages.
ranks (array-like, optional) – Manually specified ranks (if plotting several different samples together). defaults to None
ax (matplotlib.plot.axes, optional) – Axis to plot into. Defaults to None. If none, one is created.
wid (float, optional) – Width of age bar. Defaults to 0.6.
patch_dict (dict or list or None, optional) – Style for Rectangle patches. Defaults to None. If one is provided, same styling is used for all patches. Otherwise, must be same length as ages.
- Returns:
ax – Axis with plot
- Return type:
matplotlib.plot.axes
- radage.plotting.age_rank_plot_samples(samples_dict, sample_spacing=1, ax=None, sample_fontsize=10, sample_label_loc='top', **kwargs)[source]¶
Plot age rank diagrams for multiple samples
- Parameters:
samples_dict (dict) –
- Dictionary with samples as keys. Each key has another dictionary with required keys ‘ages’, ‘ages 2s’ which have arrays of the same length to plot ages. Optional keys are
’style’: patch_dict for age_rank_plot() ‘mean’: weighted mean; requires ‘sig’ and plots a box showing a weighted mean across the other ages ‘sig’: uncertainty on weighted mean ‘xmin’: Start coordinate for weighted mean box, in number of ages out of total for the sample. ‘xmax’: End coordinate for weighted mean box, in number of ages out of total for the sample.
sample_spacing (int, optional) – Spacing between samples. Defaults to 1.
ax (matplotlib.Axes, optional) – Axis to plot into. If None, one is created. Defaults to None.
sample_fontsize (float, optional) – Fontsize for labeling samples. Defaults to 10.
sample_label_loc (str, optional) – Location to label sample, ‘top’ or ‘bottom’. Defaults to ‘top’.
kwargs (dict) – Additional keyword arguments sent to age_rank_plot().
- Returns:
ax – Axis with plot
- Return type:
matplotlib.Axes
- radage.plotting.annotate_concordia(ages, tw=False, ax=None, ann_style=None)[source]¶
use this function to annotate concordia plots with times
ages: list of numbers in Ma to annotate and plot on concordia tw: tera wasserberg space? ann_style: dict
- radage.plotting.axlim_conc(tlims, ax=None, tw=False)[source]¶
Set x and y lims for conccordia plot based on age range
- Parameters:
tlims (array-like) – minimum and maximum age bounds to plot
ax (matplotlib.pyplot.axes, optional) – Axis to set the limits for. If None, plt.gca(). Defaults to None.
tw (boolean, optional) – Tera-Wasserburg concordia (True) or Wetherill (False) concordia. Defaults to False.
- Returns:
xlim (array-like) – x limits set
ylim (array-like) – y limits set
- radage.plotting.discordia_array(fit, ax=None, conf=0.95, n_mc=1000)[source]¶
Plot line and confidence interval for fitted discordia array
- Parameters:
fit (dict) –
Dictionary with following keys (as output by
radage.discordia_date_76_86()
):- slopefloat
Slope of discordia line
- slope_sigfloat
Uncertainty on slope of discordia line
- interceptfloat
Intercept of discordia line
- intercept_sigfloat
Uncertainty on intercept of discordia line
- slope_intercept_covfloat
Covariance of slope and intercept
- x_barfloat
centroid in x-direction
ax (matplotlib.pyplot.axes, optional) – Axes object to plot into. If None, one is generated. By default None.
conf (float or None, optional) – Confidence level for envelope, by default 0.95. If None, no envelope is plotted.
n_mc (int, optional) – Number of monte carlo simulations to run for confidence interval, by default 1000
- radage.plotting.kde_plot(radages, t=None, bw='adaptive', kernel='gauss', weights='uncertainty', ax=None, fill=True, rug=True, kde_style=None, kde_base_args=None, patch_dict=None, rug_style=None)[source]¶
Plot a kernel density estimate of ages
- Parameters:
radages (list) – List of radage.UPb objects to include in the kde
t (array-like, optional) – Time points to evaluate the kde at. If None, a default range is used. Defaults to None.
bw (str, optional) – Bandwidth method to use. Defaults to ‘adaptive’. Valid options are ‘adaptive’, ‘scott’, or a float that directly specifies a fixed bandwidth.
kernel (str, optional) – Kernel to use. Defaults to ‘gauss’. Valid options are ‘gauss’, ‘epa’
weights (str, optional) – Weights to use for the kde. Defaults to ‘uncertainty’. Valid options are ‘uncertainty’, ‘uniform’, or a 1d array of weights with same length as radages.
ax (matplotlib.pyplot.axes, optional) – Axes object to plot into. If None, one is created. Defaults to None.
fill (bool, optional) – Whether to fill the kde area under the curve. Defaults to True.
rug (bool, optional) – Whether to plot a rug plot of the ages below the kde. Defaults to True.
kde_style (dict, optional) – Dictionary of style parameters for the kde line. Defaults to None. If None, a default style is used.
kde_base_args (dict, optional) – Dictionary of base arguments for the kde function. Defaults to None.
patch_dict (dict or list, optional) – Dictionary of style parameters for the fill_between patch. Defaults to None. If None, a default style is used.
rug_style (dict, optional) – Dictionary of style parameters for the rug plot lines. Defaults to None. If None, a default style is used.
- Returns:
ax – Axes object with plot
- Return type:
matplotlib.pyplot.axes
- radage.plotting.plot_ages_concordia(ages=[], t1=None, t2=None, tw=False, labels=None, max_t_labels=10, concordia_env=False, concordia_conf=0.95, ax=None, patch_dict=None, concordia_style=None, concordia_conf_style=None, labels_style=None, labels_text_style=None)[source]¶
Draw age ellipses on a labeled concordia plot.
- Parameters:
ages (1d array-like) – list of UPb objects to plot
t1 (float, optional) – Youngest age to consider (Myr), defaults to youngest age in ages
t2 (float, optional) – Oldest age to consider (Myr), defaults to oldest age in ages
tw (boolean, optional) – Tera Wassergburg or conventional concordia, defaults to False
labels (1d array_like, optional) – Time points to label on concordia. Takes precedence over n_t_labels, defaults to None.
max_labels (int, optional) – Maxmium number of points on concordia to be labeled with ages in Ma. Defaults to 10.
concordia_env (boolean, optional) – Whether or not to plot uncertainty on concordia, defaults to False
concordia_conf (float, optional) – Confidence interval for concordia uncertainty. Defaults to 0.95
ax (matplotlib.axes, optional) – Axis to plot. If None, a new axis is created. Defaults to None.
patch_dict (dict or list, optional) – list of dictionary of style parameters for the ellipse patch object. If a single dictionary is provided, it will be used for all ages. If None, a default style will be used.
concordia_style (dict, optional) – Dictionary of style parameters for the concordia line
concordia_conf_style (dict, optional) – Dictionary of style parameters for the concordia confidence interval, plotted as a patch
labels_style (dict, optional) – Dictionary of style parameters for marker plotting of labeled times.
labels_text_style (dict, optional) – Dictionary of style parameters for text labels of ages.
- Returns:
ax – Axis object with plot.
- Return type:
matplotlib.axes
- radage.plotting.plot_ellipses_68_75(ages, conf=0.95, patch_dict=None, ax=None)[source]¶
Plot uncertainty ellipses for 206/238-207/235 ages
- Parameters:
ages (list) – List of radage.UPb objects
conf (float, optional) – Confidence level of ellipses, by default 0.95
patch_dict (dict or list, optional) – Styling dictionary or list of dictionaries. If None, default styling. If list, must be same length as ages. By default None
ax (matplotlib.pyplot.axes, optional) – Axes object to plot into. If None, one is generated. By default None.
- Returns:
ax – Axes object with plot
- Return type:
matplotlib.pyplot.axes
- radage.plotting.plot_ellipses_76_86(ages, conf=0.95, patch_dict=None, ax=None)[source]¶
Plot uncertainty ellipses for 207/206-238/206 ages
- Parameters:
ages (list) – List of radage.UPb objects
conf (float, optional) – Confidence level of ellipses, by default 0.95
patch_dict (dict or list, optional) – Styling dictionary or list of dictionaries. If None, default styling. If list, must be same length as ages. By default None
ax (matplotlib.pyplot.axes, optional) – Axes object to plot into. If None, one is generated. By default None.
- Returns:
ax – Axes object with plot
- Return type:
matplotlib.pyplot.axes