isotopylog.HeatingExperiment.plot

HeatingExperiment.plot(ax=None, yaxis='D', logy=False, plot_reg=False, ed={'fmt': 'o'}, ld={}, fbd={'alpha': 0.5}, regd={})

Plots experimental and forward-modeled results in various user-defined ways.

Parameters:
  • ax (plt.axis or None) – Matplotlib axis instance to plot data on. If None, creates an axis. Defaults to None.
  • yaxis (string) – The variable to plot on the y axis, either 'D' or 'G'. Defaults to 'D'.
  • logy (boolean) – Tells the funciton whether or not to log transform the y axis. Defaults to False.
  • plot_reg (boolean) – Tells the function whether or not to plot regularized inversion forward-model results as well. Only applies if model = 'HH21' and fit_reg = True.
  • ed (dictionary) – Dictionary of keyward arguments to pass for plotting the experimental data. Must contain keywords compatible with matplotlib.pyplot.errorbar. Defaults to dictionary with ‘fmt’ = ‘o’.
  • ld (dictionary) – Dictionary of keyward arguments to pass for plotting the mean of the forward-modeled data. Must contain keywords compatible with matplotlib.pyplot.plot. Defaults to empty dictionary.
  • fbd (dictionary) –

    Dictionary of keyward arguments to pass for plotting the forward- modeled uncertaint range. Must contain keywords compatible with matplotlib.pyplot.errorbar. Defaults to dictionary with ‘alpha’

    = 0.5..
  • regd (dictionary) – Dictionary of keyword arguments to pass for plotting the regularized forward-model data. Must contain keywords compatible with matplotlib.pyplot.plot. Defaults to empty dictionary.
Returns:

ax – Updated axis instance containing the plot.

Return type:

plt.axis

Warning

UserWarning
If the user is passing plot_reg = True but the heating experiment does not contain regularized inverse model forward results; that is, if it was fit with something other than 'HH21' model with fit_reg = True.

See also

isotopylog.kDistribution.plot()
Plotting function for the kDistribution class.
isotopylog.EDistribution.plot()
Plotting function for the EDistribution class.

Examples

Plotting experimental and forward-modeled results:

#make an axis
fig, ax = plt.subplots(2,2,sharex = True)

#first, plot D
ax[0,0] = he.plot(ax = ax[0,0], yaxis = 'D', logy = False)

#second, plot G
ax[0,1] = he.plot(ax = ax[0,1], yaxis = 'G', logy = False)

#third, plot log(D)
ax[1,0] = he.plot(ax = ax[1,0], yaxis = 'D', logy = True)

#finally, plot log(G)
ax[1,1] = he.plot(ax = ax[1,1], yaxis = 'G', logy = True)
../../_images/he_1.png

When making plots, one can pass various dictionaries containing stylistic keyword arguments:

fig, ax = plt.subplots(1,1)

#experimental data plt.errorbar dict
ed = {fmt = 'o', ecolor = 'k'}

#forward-modeled mean plt.plot dict
ld = {linewidth = 2, c = 'k'}

#forward-modeled uncertainty plt.fill_between dict
fbd = {alpha = 0.5, color = [0.5, 0.5, 0.5]}

#plot the data
ax = he.plot(ax = ax, ed = ed, ld = ld, fbd = fbd)
../../_images/he_2.png